Skip to content

Update opentelemetry conventions #245

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

Merged
merged 4 commits into from
Jul 7, 2025
Merged

Conversation

miguelgrinberg
Copy link
Contributor

This change updates our OpenTelemetry conventions.

@miguelgrinberg miguelgrinberg requested a review from pquentin June 26, 2025 15:58
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

This will also need to be updated in elasticsearch-py:

  • f"db.elasticsearch.path_parts.{key}" to f"db.operation.parameter.{key}"

Also some recommended stuff:

  • db.operation.batch.size in bulk helpers
  • db.collection.name if one path part is index?

We don't handle errors at all, and we likely should. It's required in the spec.

But this definitely fixes existing stuff, so thank you!

) -> None:
if self.otel_span is None:
return

# url.full does not contain auth info which is passed as headers
self.otel_span.set_attribute("url.full", base_url + target)
self.otel_span.set_attribute("http.request.method", method)
self.otel_span.set_attribute("server.address", host)
self.otel_span.set_attribute("server.port", port)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be added only if not 9200 for HTTP and 443 for HTTPS?

Copy link
Contributor Author

@miguelgrinberg miguelgrinberg Jul 3, 2025

Choose a reason for hiding this comment

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

I can actually remove the HTTP method from here since the client already adds it. Or better yet, I'll just leave it. This is exactly how the client adds it as well.

@miguelgrinberg
Copy link
Contributor Author

Added elastic/elasticsearch-py#2999 in the client with some of the updates you suggested.

@miguelgrinberg miguelgrinberg merged commit da5f360 into main Jul 7, 2025
33 of 38 checks passed
@miguelgrinberg miguelgrinberg deleted the update-otel-conventions branch July 7, 2025 14:06
github-actions bot pushed a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
github-actions bot pushed a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
github-actions bot pushed a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
miguelgrinberg added a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
miguelgrinberg added a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
miguelgrinberg added a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)
miguelgrinberg added a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Jul 10, 2025
* update opentelemetry conventions

* linter fixes

* add response status codes

* update requests URL for intersphinx

(cherry picked from commit da5f360)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Jul 11, 2025
miguelgrinberg added a commit that referenced this pull request Jul 14, 2025
* Revert "Update opentelemetry conventions (#245) (#249)"

This reverts commit c7e210d.

* keep the linter updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants