Skip to content

Adding opentelemetry - #4548

Open
bitbyt3r wants to merge 4 commits into
mainfrom
opentelemetry
Open

Adding opentelemetry#4548
bitbyt3r wants to merge 4 commits into
mainfrom
opentelemetry

Conversation

@bitbyt3r

@bitbyt3r bitbyt3r commented Mar 7, 2026

Copy link
Copy Markdown
Member

This adds opentelemetry support to ubersystem.

Config:

[otel]
enabled = True
endpoint = http://signoz-otel-collector:4318/v1
sample_rate = 50 # Only log 50% of the requests
tools.otel_request_attrs.on = True
tools.otel_metrics.on = True
tools.otel_reset.on = True
server_name = super2024

This requires line of sight to an opentelemetry collector server. When enabled, it pushes:

  • Logs
  • HTTP Request traces which contain:
    • DB Requests
    • Outgoing HTTP requests made with the requests library
    • Jinja template compile/render
    • View functions
  • Metrics (Currently not many. #db queries, #rows returned, page render time)
  • Exceptions
Screenshot 2026-03-07 at 03 03 52

All of the above are corollated with each other, so you can dig into any web request and see the logs, exceptions, DB queries, etc that it made.

@bitbyt3r
bitbyt3r marked this pull request as ready for review March 7, 2026 07:56

@kitsuta kitsuta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment thread uber/config.py
_unrepr(_config['appconf'])
c.APPCONF = _config['appconf'].dict()
c.SENTRY = _config['sentry'].dict()
c.OTEL = _config.get('otel', {'enabled': False, 'endpoint': 'http://localhost:4317', 'sample_rate': 100}).dict() if hasattr(_config.get('otel'), 'dict') else _config.get('otel', {'enabled': False, 'endpoint': 'http://localhost:4317', 'sample_rate': 100})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're putting defaults in the configspec file, do we need this set of hardcoded defaults?

Comment thread requirements.txt
XlsxWriter==3.2.5
xmlsec==1.3.16

opentelemetry-api

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we pin these libraries? I'd hate to get a broken build because our telemetry library had a breaking change.

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.

2 participants