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

Support complex attribute values on logs/events in semantic conventions #1669

Open
lmolkova opened this issue Dec 10, 2024 · 2 comments
Open

Comments

@lmolkova
Copy link
Contributor

lmolkova commented Dec 10, 2024

LogRecord attributes are special - they support complex attribute types unlike spans/metrics/resources that support standard attributes only (primitives and arrays of primitives). Note that the latter is the API limitation (not an OTLP one)

In semconv we assume that all attributes are cross-signal and therefore are limited to 'standard' attribute types.

The proposal is to lift this limitation and allow defining complex attributes in semantic conventions with the following limitations:

  • they cannot be referenced on spans, metrics, or resources/entities. TBD: check with profiles
    • this can be solved via the semconv policy (given that attribute types are limited on the OTel API surface and not the protocol, we might not want to hardcode it in weaver)
  • we should define if/how such attributes would interact with the standard attributes. E.g. are geo.location.lat=x and geo.location.lon=y attributes set on a span equivalent to geo.location={"lat": x, "lon": y} set on the log record?

This would help with the following problems:

Related: open-telemetry/opentelemetry-specification#4334, open-telemetry/opentelemetry-specification#2888

@lmolkova
Copy link
Contributor Author

lmolkova commented Dec 17, 2024

Discussed at the spec call on 12/17

Some feedback/notes:

  • Backends might leverage complex attributes if they start to pop up, but it does not seem like there is a burning need for them
  • Prometheus would have a problem. Overall, complex attributes on metrics do not seem to be useful
  • We can keep the door for complex attributes on spans open (and special-case metrics or support flattening for them)
  • We can make the first step with complex attributes on logs (as a testing ground)

The first step:

  • we should define anything that should be set across signals as a standard attribute
  • we can additionally define a complex attribute that includes standard attributes.
  • we need to define flattening rules for complex attributes - only things that can be flattened can be used for cross-signal correlation

Things to figure out:

@felixbarny
Copy link

Just to add a use case for where complex attributes on spans would be useful: using the geoipprocessor on the source.address attribute. But I agree that starting with logs and expanding to spans later sounds like a good approach 👍

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

No branches or pull requests

2 participants