Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify resource label as 'from_attribute' in routingprocessor #3746

Closed
maxsivkov opened this issue Jun 9, 2021 · 4 comments
Closed
Labels
enhancement New feature or request question Further information is requested Stale

Comments

@maxsivkov
Copy link

maxsivkov commented Jun 9, 2021

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

Describe the solution you'd like
Currently from_attribute can reference http header only. Allowing to specify resource label (from the ResourceSpansSlice struct) as from_attribute allows to route traces based on attributes gathered earlier. For example to route trace to specific exporter based on a pod name (gathered by k8sprocessor)

Describe alternatives you've considered
Cannot find out any

Additional context
Each resource should be processed individually based on a resource's attribute value.
In this case batching will not work.
may be we need to introduce additional parameter like attribute_source with values FromHeader and FromResource.

Currently I am studying opentelemetry, so I may be wrong with terminology.
with 'resource attributes' I mean attribute from the following map
https://github.com/open-telemetry/opentelemetry-collector/blob/c71f5bbe77492603f52a19a857d5db3de3bce2d3/consumer/pdata/generated_resource.go#L47

@github-actions github-actions bot added the Stale label Aug 12, 2021
@bogdandrutu bogdandrutu removed the Stale label Aug 16, 2021
alexperez52 referenced this issue in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
…interesting (#3746)

- added http client and server to make the traces more interesting and not single span.
- simplified the demo by removing the traces and metrics load generators and the OTel-agent.
- updated the libraries and the code to use the latest OTEL APIs
@pmalek-sumo
Copy link
Contributor

@maxsivkov 👋

Haven't #5694 and #5869 covered what you've described above?

@jpkrohling jpkrohling added enhancement New feature or request question Further information is requested labels Jan 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

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.

@github-actions github-actions bot added the Stale label Nov 7, 2022
@kovrus
Copy link
Member

kovrus commented Nov 7, 2022

@maxsivkov The routing processor is able to do that with both conventional configuration and OTTL statements, see Readme.

@jpkrohling can you please close the issue?

@vchirikov
Copy link

vchirikov commented Nov 30, 2022

processors:
  routing:
    default_exporters: [elasticsearch/default]
    table:
      - statement: route() where (resource.attributes["k8s.namespace.name"] == "infra" && resource.attributes["k8s.container.name"] != "access-logs") || resource.attributes["k8s.namespace.name"] == "flux-system"
        exporters: [elasticsearch/infra]
      - statement: route() where resource.attributes["k8s.namespace.name"] == "infra" && resource.attributes["k8s.container.name"] == "access-logs"
        exporters: [elasticsearch/ingress]
      - statement: route() where resource.attributes["k8s.namespace.name"] == "staging" && resource.attributes["k8s.container.name"] == "app"
        exporters: [elasticsearch/apps]

Logs:

Error: invalid configuration: processor "routing" has invalid configuration: invalid attribute to read the route's value from: the FromAttribute property is empty
2022-11-30 13:55:57.699034 I | collector server run finished with error: invalid configuration: processor "routing" has invalid configuration: invalid attribute to read the route's value from: the FromAttribute property is empty

@kovrus / @jpkrohling looks like OTTL in routing doesn't work without from_attribute, isn't it?
How can I achieve something like this?
p.s. otel/opentelemetry-collector-contrib:0.66.0 version


upd: created a new issue for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

6 participants