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
OpenSearch exporter supports sending OpenTelemetry signals as documents to [OpenSearch](https://www.opensearch.org).
18
20
19
21
The documents are sent using [observability catalog](https://github.com/opensearch-project/opensearch-catalog/tree/main/schema/observability) schema.
20
22
21
23
## Configuration options
24
+
22
25
### Indexing Options
26
+
23
27
The Observability indices would follow the recommended pattern for immutable data stream ingestion using
24
28
the [data_stream](https://opensearch.org/docs/latest/dashboards/im-dashboards/datastream) concepts.
25
29
Index pattern will follow the next naming template `ss4o_{type}-{dataset}-{namespace}`
30
+
26
31
-`dataset` (default=`default`) a user-provided label to classify source of telemetry. It is used to construct the name of the destination index or data stream.
27
32
-`namespace` (default=`namespace`) a user-provided label to group telemetry. It is used to construct the name of the destination index or data stream.
28
33
29
34
LogsIndex configures the index, index alias, or data stream name logs should be indexed in.
35
+
30
36
-`logs_index` a user-provided label to specify name of the destination index or data stream.
31
37
38
+
## Dynamic Log Indexing
39
+
40
+
The OpenSearch exporter supports dynamic log index names using placeholders in the `logs_index` config. You can use any attribute or context key as a placeholder to construct index names dynamically per log record.
41
+
42
+
- Placeholder: `%{key}`
43
+
44
+
- Example: `otel-logs-%{service.name}` or `otel-logs-%{custom.label}`
45
+
- The value is looked up from a context map (resource attributes, log attributes, etc.).
46
+
- If the key is missing, the value from `logs_index_fallback` is used (or `unknown` if not set).
47
+
48
+
- Time Suffix: You can append a time-formatted suffix to the index name using the `logs_index_time_format` option.
49
+
-`logs_index_time_format`: If set, appends a time suffix to the resolved index name using the specified format (default is no suffix).
50
+
51
+
### Example Configuration
52
+
53
+
````yaml
54
+
exporters:
55
+
opensearch:
56
+
http:
57
+
endpoint: https://opensearch.example.com:9200
58
+
logs_index: "otel-logs-%{service.name}"
59
+
logs_index_fallback: "default-service"# optional, if not set default is ss4o_logs-default-namespace
60
+
logs_index_time_format: "yyyy.MM.dd"# optional, if set appends time suffix
61
+
62
+
This will create log indexes like `otel-logs-myservice-2024.06.07`. If `service.name` is missing, `otel-logs-default-service-2024.06.07` will be used.
63
+
32
64
### HTTP Connection Options
65
+
33
66
OpenSearch export supports standard [HTTP client settings](https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp#client-configuration).
67
+
34
68
- `http.endpoint`(required) `<url>:<port>` of OpenSearch node to send data to.
35
69
36
70
### TLS settings
71
+
37
72
Supports standard TLS settings as part of HTTP settings. See [TLS Configuration/Client Settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md#client-configuration).
38
73
39
74
### Retry Options
75
+
40
76
- `retry_on_failure`: See [retry_on_failure](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md)
41
77
42
78
### Sending Queue Options
79
+
43
80
- `sending_queue`: See [sending_queue](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md)
44
81
45
82
### Timeout Options
83
+
46
84
- `timeout` : See [timeout](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md)
47
85
48
86
### Bulk Indexer Options
49
-
-`bulk_action` (optional): the [action](https://opensearch.org/docs/2.9/api-reference/document-apis/bulk/) for ingesting data. Only `create` and `index` are allowed here.
87
+
88
+
- `bulk_action` (optional): the [action](https://opensearch.org/docs/2.9/api-reference/document-apis/bulk/) for ingesting data. Only `create` and `index` are allowed here.
0 commit comments