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

feat: Add integration for github.com/astaxie/beego #200

Merged
merged 25 commits into from
Aug 18, 2020

Conversation

reggiemcdonald
Copy link
Contributor

@reggiemcdonald reggiemcdonald commented Aug 7, 2020

github.com/astaxie/beego Integration

Description

This PR provides beego instrumentation.

Implementation

This integration makes use of the net/http integration to provide tracing to HTTP requests.

HTTP requests to the beego app running this middleware will be traced.

The following options are provided:

  • WithTracer(trace.Tracer)
  • WithMeter(metric.Meter)
  • WithPropagators(propagation.Propagators)
  • WithFilter(Filter)
  • WithSpanNameFormatter(Formatter)

which allows users to specify the tracer, meter and propagators to be used. In accordance with the semantic conventions, span names are generated from the path of the HTTP request by default. Users are able to override this behaviour with the provided WithSpanNameFormatter option.
WithFilter allows users to filter out which requests should be traced.

Additionally, Beego supports HTML template rendering using calls to beego.Controller.Render. This instrumentation provides a wrapper function to add a child span to the rendering of the template files.

A dockerized example can be found here. In an effort to keep this PR shorter, I've decided to move the example to a separate PR, which I'll open once this gets merged.

TODO

  • Additional testing
  • Tracing render

Addresses: #82

/cc @nlehrer @danherr

@reggiemcdonald reggiemcdonald marked this pull request as ready for review August 12, 2020 03:10
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

The approach looks good, especially the testing, well done. Had some minor comments/suggestions around naming and docs.

instrumentation/github.com/astaxie/beego/README.md Outdated Show resolved Hide resolved
instrumentation/github.com/astaxie/beego/README.md Outdated Show resolved Hide resolved
instrumentation/github.com/astaxie/beego/README.md Outdated Show resolved Hide resolved
instrumentation/github.com/astaxie/beego/README.md Outdated Show resolved Hide resolved
instrumentation/github.com/astaxie/beego/README.md Outdated Show resolved Hide resolved
instrumentation/github.com/astaxie/beego/beego.go Outdated Show resolved Hide resolved
@Aneurysm9
Copy link
Member

@reggiemcdonald can you add a CHANGELOG.md entry for this? I think this is otherwise ready to merge.

@MrAlias MrAlias merged commit d58e0e8 into open-telemetry:master Aug 18, 2020
@pellared pellared added this to the untracked milestone Nov 8, 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
Development

Successfully merging this pull request may close these issues.

5 participants