Skip to content

Conversation

@jsvd
Copy link
Contributor

@jsvd jsvd commented Dec 10, 2025

Description

Adds the initial skeleton for a lookup processor that performs external lookups to enrich telemetry signals:

  • Processor factory with logs support (traces/metrics planned)
  • Source abstraction with factory pattern for extensibility
  • Built-in noop source for testing
  • Cache wrapper utility for source implementations
  • WithSources option for custom source registration

Link to tracking issue

First part of #41816

Testing

Zero testing so far.
I'll add processor and lookupsource factory testing in a separate PR.
More tests will be added when the processor implementation is added.

Documentation

For now most of it is in README.md

Adds the initial skeleton for a lookup processor that performs external
lookups to enrich telemetry signals:

- Processor factory with logs support (traces/metrics planned)
- Source abstraction with factory pattern for extensibility
- Built-in noop source for testing
- Cache wrapper utility for source implementations
- WithSources option for custom source registration
@jsvd jsvd marked this pull request as ready for review December 11, 2025 22:09
@jsvd jsvd requested a review from a team as a code owner December 11, 2025 22:09
@jsvd jsvd requested a review from braydonk December 11, 2025 22:09
@jagan2221
Copy link
Contributor

jagan2221 commented Dec 12, 2025

Hi @jsvd, Just some suggestions(Pls ignore if you already planned these for next phase)

  1. Since this lookup processor is going to be extended to a wide variety of lookups, would it makes sense to add "context (resource/record)" parameter as well to the settings? since LookupFunc interface definition just accepts the key(string) to perform lookup.
  2. Once source.lookup is done, how are going to add the resolved value to attributes?
    Example: (Defined in the component proposal desc) we have this section which is common for the processor irrespective of the type of lookup.
    attributes:
    • key: client.hostname
      from_attribute: client.ip
      default: "unknown"
      action: upsert
      context: log

@jsvd
Copy link
Contributor Author

jsvd commented Dec 12, 2025

@jagan2221 this PR is mostly just the skeleton, doesn't yet have the processor implementation itself.
I have a second PR incoming, you can see the code in my personal repo here jsvd#3, it is a single commit on top of the commit from this PR.

The README shows how the processor actually works with a source: https://github.com/jsvd/opentelemetry-collector-contrib/blob/adc7da937d1b65e1272296a4b0081d23fa6e83d8/processor/lookupprocessor/README.md#configuration

processors:
  lookup:
    source:
      type: yaml
      path: /etc/otel/mappings.yaml
    attributes:
      - key: user.name
        from_attribute: user.id
        default: "Unknown User"
        action: upsert
        context: record

Does this satisfy your needs?

@jagan2221
Copy link
Contributor

Looks good then, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants