You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/opentelemetry-howto.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -422,6 +422,43 @@ When you export your data by using OpenTelemetry, keep these considerations in m
422
422
* You don't need to manually register middleware; the Java worker autodiscovers `OpenTelemetryInvocationMiddleware`.
423
423
::: zone-end
424
424
425
+
## Resource detectors and semantic conventions
426
+
427
+
In Azure Functions, resource attributes describe the function app process and its environment. Span attributes describe a single invocation.
428
+
429
+
### Default behavior (no action required)
430
+
431
+
In Azure Functions on App Service, resource detectors typically populate common attributes automatically, including:
432
+
433
+
- `service.name` (defaults to the function app name)
434
+
- Azure cloud attributes such as `cloud.provider`, `cloud.region`, and `cloud.resource_id`
435
+
436
+
In most cases, these defaults are sufficient for correct Application Map grouping and Azure context.
437
+
438
+
### When to override `service.name` (Cloud Role Name)
439
+
440
+
Override only if you need a different, stable node name in Application Insights (Application Map grouping), for example to normalize naming across slots or environments.
441
+
442
+
Set `OTEL_SERVICE_NAME` to override the detected value:
Azure Functions’ OpenTelemetry integration typically emits FaaS invocation attributes on the invocation span. Avoid setting these manually unless you are creating your own invocation span:
451
+
452
+
-`faas.name` (function name)
453
+
-`faas.trigger` (for example `http`, `servicebus`, `eventhubs`)
> Function apps can host multiple functions in one process. Do not put function-specific values on the resource. Put per-invocation identity on spans.
458
+
459
+
> [!NOTE]
460
+
> When running locally (Functions Core Tools) or in containerized/self-hosted environments where Azure metadata is unavailable, `service.name` may default to a generic value. Set `OTEL_SERVICE_NAME` locally to match production naming.
461
+
425
462
## Troubleshooting
426
463
427
464
When you export your data by using OpenTelemetry, keep these common issues and solutions in mind.
0 commit comments