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

Fix instrumentation of input/output token consumed to be recognized as numeric attributes #188

Closed
2 tasks done
Rindrics opened this issue Dec 9, 2024 · 3 comments · Fixed by #189
Closed
2 tasks done
Assignees

Comments

@Rindrics
Copy link
Contributor

Rindrics commented Dec 9, 2024

Task description

Fix instrumentation of input/output token consumed to be recognized as numeric attributes

Background

Additional context

Although we are sending business metrics (token consumption is a kind of business metrics) to our observability backend now, we are planning to send them to to BI platform in the future.

Ways to resolve current problem

  • option 1: send input/output tokens as structured log using body field
    • pros: (slightly) better in data representation because two attributes related to token consumption can be represented as child attributes of tokenConsumed
    • cons:
      • bad in uniformity because "only" token consumption data is sent in body field although other metrics are
      • still requires preprocessing pipeline to get input/output token from body field
  • option 2: send input/output tokens as two flat attributes
    • pros: no preprocessing parser required
    • cons: (slightly) bad in data representation

TODO (Optional)

  • decide which option to choose
  • fix current instrumentation
@Rindrics
Copy link
Contributor Author

Rindrics commented Dec 9, 2024

option 2 seems better for us because it requires no additional configuration

@Rindrics
Copy link
Contributor Author

Rindrics commented Dec 9, 2024

We have at least additional two options where to define data processor when we choose option 1

  • option 1-a: OTEL collector
    • pros: no coupling with specific telemetry backend
    • cons:
      • requires infrastructure cost
      • (we do not have separated OTEL collector yet)
  • option 1-b: telemetry backend
    • pros: shorter implementation time in current state
    • cons: processor resource is bound to telemetry backend

@Rindrics
Copy link
Contributor Author

Rindrics commented Dec 9, 2024

I suggest:

  • sending tokenConsumedInput and tokenConsumedOutput as two flat attributes (option 2)
  • using body to send nested attributes and deploying separate collector if we need many kinds of structured attributes in the future (option 1-a)

@Rindrics Rindrics changed the title Flatten tokenConsumed to postpone introduction of parser pipeline Fix instrumentation of input/output token consumed to be recognized as numeric attributes Dec 9, 2024
@Rindrics Rindrics self-assigned this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant