open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.06k stars 2.36k forks source link

[exporter/awscloudwatchlogs] placeholders support for log_group_name and log_stream_name #30773

Open prashant-shahi opened 9 months ago

prashant-shahi commented 9 months ago

Component(s)

exporter/awscloudwatchlogs

Is your feature request related to a problem? Please describe.

Yes.

Currently, all incoming log data are written to a single log group/stream by the exporter. Making it difficult to filter them in AWS Cloudwatch.

Describe the solution you'd like

Support for placeholders like:

Similar to the format supported by awsemfexporter. With the values supported from OpenTelemetry ECS-like attributes.

Describe alternatives you've considered

No response

Additional context

No response

/cc @boostchicken, @bryan-aguilar, @rapphil

github-actions[bot] commented 9 months ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

bryan-aguilar commented 9 months ago

I've thought about this in the past but don't have anything written down quite yet. I think there are a few different options to go with and I would seek something a bit more permissive than the original suggestion. I think one of the thoughts that I have had in the past is that the exporter could look for a specific resource attribute, if present use that. It gives more options for where that resource attributes is populated.

sbarhouche commented 9 months ago

@bryan-aguilar it could be similar to the approach followed by fluentbit for aws image

koenvandesande commented 8 months ago

Being able to reference attributes from the log message itself for the logStreamName would be nice (to split it out again over containers/components). Or referencing something unique like the date or time that the collector started.

github-actions[bot] commented 6 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

sbarhouche commented 5 months ago

@bryan-aguilar any workaround for this ?

bpalermo commented 5 months ago

For simple use cases, at the very least we could start with support for templating based on attributes for the log stream name, since it's possible to use routingprocessor to route to different log groups. Although this is not ideal since would mean multiple exporters.

github-actions[bot] commented 3 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

using-system commented 2 months ago

Same here ! We needs for this features because we want to have on collector for mulitple app and each app has his own log group name !

any update ?

eOkadas commented 2 months ago

It would seem this use case of sharing a collector and having it dispatch to different log groups is a widespread need. We have the same issue.

github-actions[bot] commented 4 weeks ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

sbarhouche commented 6 days ago

Pinging code owners:

exporter/awscloudwatchlogs: @boostchicken @bryan-aguilar @rapphil