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

Add Telemetry support #208

Merged
merged 122 commits into from
Aug 5, 2024
Merged

Add Telemetry support #208

merged 122 commits into from
Aug 5, 2024

Conversation

jterapin
Copy link
Contributor

@jterapin jterapin commented Jul 11, 2024

Description

Observability is the extent to which a system's current state can be inferred from the data it emits. The data emitted is commonly referred to as telemetry. This PR will set up the groundwork for SDK instrumentation and current/future telemetry providers.

In addition, we will support OpenTelemetry as a telemetry provider.

Related PR: alextwoods/aws-sdk-ruby-v4#54

Changes

  • Add opentelemetry-sdk gem for testing purposes
  • Codegen
    • Update FakeProtocol's BuilderGenerator to render http_method (intended for span attribute testing)
    • Update config_spec.rb to include the new Config, telemetry_provider.
    • Add telemetry_spec.rb to test Config and Client behaviors (includes OTel-related testings)
    • Add smithy file to test isolate and test telemetry components
    • Update ClientGenerator to include render telemetry code for each operation
    • Update MiddlewareBuilder to include new config, telemetry_provider
    • Update RubySettings to generate/access SDK_ID (if no SDK ID is present, we use Service Shape name)
  • Hearth
    • Update Context to have access to a tracer
    • Update Send Middleware to emit telemetry (for both stub and send responses)
    • Add telemetry components, no-op classes and otel support (only tracing supported)
    • Add RBS signatures for telemetry components
    • Update send_spec.rb as adding telemetry support has changed how the tests are run
    • Add specs for telemetry components

* Add V4 support (separate PR in V4 repo)
* Create child span on a middleware level
* Update specs based on the child span + add more specs
* Add documentation


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

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

Nice, looks good!

Copy link
Contributor

@mullermp mullermp left a comment

Choose a reason for hiding this comment

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

Looks good so far

codegen/projections/rails_json/lib/rails_json/client.rb Outdated Show resolved Hide resolved
hearth/lib/hearth/middleware/send.rb Outdated Show resolved Hide resolved
hearth/lib/hearth/middleware/send.rb Outdated Show resolved Hide resolved
hearth/lib/hearth/telemetry.rb Outdated Show resolved Hide resolved
hearth/lib/hearth/telemetry.rb Show resolved Hide resolved
hearth/sig/lib/hearth/telemetry.rbs Outdated Show resolved Hide resolved
hearth/spec/hearth/telemetry/otel_spec.rb Outdated Show resolved Hide resolved
hearth/spec/hearth/telemetry/otel_spec.rb Outdated Show resolved Hide resolved
hearth/spec/hearth/telemetry/otel_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@mullermp mullermp left a comment

Choose a reason for hiding this comment

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

Nice! I generally approve, just needs a few clean ups.

hearth/lib/hearth/telemetry/base.rb Outdated Show resolved Hide resolved
hearth/sig/lib/hearth/telemetry/otel.rbs Show resolved Hide resolved
@jterapin jterapin merged commit ae79a0c into main Aug 5, 2024
26 checks passed
@jterapin jterapin deleted the implement_observability branch August 5, 2024 18:56
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