Azureblob Exporter
contrib
Maintainers: @hgaol, @MovieStoreGuy
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Configuration
The following settings are required:- url: Must be specified if auth type is not connection_string. If auth type is connection_string, itโs optional or will be override by the auth.connection_string. Azure storage account endpoint. This setting might be replaced with
endpointfor future. e.g. https://<account-name>.blob.core.windows.net/ - auth (no default): Authentication method for exporter to ingest data.
- type (no default): Authentication type for exporter. supported values are: connection_string, service_principal, system_managed_identity, user_managed_identity and workload_identity.
- tenand_id: Tenand Id for the client, only needed when type is service_principal and workload_identity.
- client_id: Client Id for the auth, only needed when type is service_principal, user_managed_identity and workload_identity.
- client_secret: Secret for the client, only needed when type is service_principal.
- connection_string: Connection string to the endpoint. Only needed for connection_string auth type. Once provided, itโll override the
urlparameter to the storage account. - federated_token_file: The path of the projected service account token file, only needed when type is workload_identity.
- container: container for metrics, logs and traces. A container organizes a set of blobs, similar to a directory in a file system. More details can refer this.
- metrics (default
metrics): container to store metrics. default value ismetrics. - logs (default
logs): container to store logs. default value islogs. - traces (default
traces): container to store traces. default value istraces.
- metrics (default
- blob_name_format: the final blob name will be blob_name
- template_enabled (default
false): enables Go template parsing for blob name formats. If parsing fails, it will not throw an error but will log a warning and continue formatting the blob name using other rules. - metrics_format (default
2006/01/02/metrics_15_04_05.json): blob name format. The date format follows constants in Golang, refer here. - logs_format (default
2006/01/02/logs_15_04_05.json): blob name format. - traces_format (default
2006/01/02/traces_15_04_05.json): blob name format. - timezone (default
""): Timezone for blob name formatting. Local time is used if empty. Must be a valid IANA timezone identifier accepted by Golangโstime.LoadLocation, such asUTCorAmerica/New_York. - serial_num_enabled (default
true): toggles whether a random serial number is appended to the blob name. - serial_num_range (default
10000): a range of random number to be appended after blob_name. e.g.blob_name_{serial_num}. the number will be in[0, serial_num_range). - serial_num_before_extension (default
false): places the serial number before the file extension if there is one. e.gblob_name_{serial_num}.jsoninstead ofblob_name.json_{serial_num} - time_parser_enabled (default
true): controls whether the exporter interprets the format string as a Go time layout. Whenfalse, values such as2006or15_04_05are treated as literal text. - time_parser_ranges (default
nil): limits time formatting to specific parts of the blob name. When not set (nil), the entire blob name is time-formatted iftime_parser_enabledistrue. Provide a list of character ranges like["0-10", "15-25"]to only apply time formatting within those positions. For example, if your blob name isprefix/2006/01/02/file.jsonand you settime_parser_ranges: ["7-17"], only the2006/01/02portion will be replaced with actual date values, whileprefix/and/file.jsonremain unchanged. This is helpful when your blob name contains patterns like2006that you want to keep as literal text.
- template_enabled (default
- format (default
json):jsonorproto. which present otel json or otel protobuf format, the file extension will bejsonorpb. - encodings (default using encoding specified in
format, which isjson): if specified, uses the encoding extension to encode telemetry data. Overrides format.- logs (default
nil): encoding component id. - metrics (default
nil): encoding component id. - traces (default
nil): encoding component id.
- logs (default
- append_blob: configures append blob behavior. When enabled, telemetry data is appended to a single blob instead of creating new blobs. This can be useful for aggregating data or reducing the number of blobs created.
- enabled (default
false): determines whether to use append blob mode. - separator (default
\n): string to insert between appended data blocks.
- enabled (default
retry_on_failureenabled(default = true)initial_interval(default = 5s): Time to wait after the first failure before retrying; ignored ifenabledisfalsemax_interval(default = 30s): Is the upper bound on backoff; ignored ifenabledisfalsemax_elapsed_time(default = 120s): Is the maximum amount of time spent trying to send a batch; ignored ifenabledisfalse
Blob Name Templates
Whentemplate_enabled is true, you can use Go templates in metrics_format, logs_format, and traces_format to create dynamic blob names based on telemetry data. The root object for the template is the telemetry data itself (pmetric.Metrics, plog.Logs, or ptrace.Traces).
The following template functions are available:
| Function | Description | Example |
|---|---|---|
getResourceMetricAttr | Gets a resource attribute from metrics data. | {{ getResourceMetricAttr . 0 "service.name" }} |
getResourceLogAttr | Gets a resource attribute from logs data. | {{ getResourceLogAttr . 0 "service.name" }} |
getResourceSpanAttr | Gets a resource attribute from traces data. | {{ getResourceSpanAttr . 0 "service.name" }} |
getScopeMetricAttr | Gets a scope attribute from metrics data. | {{ getScopeMetricAttr . 0 0 "scope.name" }} |
getScopeLogAttr | Gets a scope attribute from logs data. | {{ getScopeLogAttr . 0 0 "scope.name" }} |
getScopeSpanAttr | Gets a scope attribute from traces data. | {{ getScopeSpanAttr . 0 0 "scope.name" }} |
getMetric | Gets a metric object. You can chain to access its fields. | {{ (getMetric . 0 0 0).Name }} |
getLogRecord | Gets a log record object. You can chain to access its fields. | {{ (getLogRecord . 0 0 0).TraceID }} |
getSpan | Gets a span object. You can chain to access its fields. | {{ (getSpan . 0 0 0).Name }} |
Append Blob
Whenappend_blob is enabled:
- The exporter will create append blobs instead of block blobs
- New data will be appended to existing blobs rather than creating new ones
- The configured separator will be inserted between data blocks
- If the blob doesnโt exist, it will be created automatically
Configuration
Example Configuration
Last generated: 2026-04-13