-
Notifications
You must be signed in to change notification settings - Fork 18
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: Implement otel tracing hook. #130
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
a54c2d1
feat: Implement supporting types for hooks. (#125)
kinyoklion f93d96c
feat: Add support for hooks. (#126)
kinyoklion 1c56855
feat: Implement otel tracing hook.
kinyoklion b735744
chore(refactor): Remove AddHooks, refactor execution, add contract te…
kinyoklion 84f86f0
Merge branch 'feat/hooks' into rlamb/implement-otel-hook
kinyoklion 150d09e
Loop based targets and update contributing.
kinyoklion 4ab744a
Add comment to makefile
kinyoklion b041730
Support all targets in makefile.
kinyoklion 152107d
Update .PHONY
kinyoklion 722f7b2
Add experimental text.
kinyoklion 745c08c
Add use separate releases.
kinyoklion b8ec2b6
Tidy
kinyoklion b749180
Reformat example.
kinyoklion 7806865
Re-add clean.
kinyoklion 8c9d529
Change ldmodule path
kinyoklion f493f46
Remove blank line.
kinyoklion 78d794c
Merge branch 'v7' into rlamb/implement-otel-hook
kinyoklion 51f15d5
Update version of go server SDK used.
kinyoklion 7d99137
Update makefile to work regardless of workspace.
kinyoklion b21bd61
Attempt at CI.
kinyoklion d9a0493
No contract tests for ldotel.
kinyoklion 57056a9
Conditions.
kinyoklion cad7c92
Split testing.
kinyoklion f7455cf
Fix name
kinyoklion e5a7bc9
Cleanup name.
kinyoklion 7199460
Fix base CI workflow.
kinyoklion ac70cab
Add readme.
kinyoklion ec7d52d
Issue templates
kinyoklion 0c7461f
Remove extra links.
kinyoklion beb9a75
Unique test result files.
kinyoklion eeae3e5
Go version from matrix.
kinyoklion 509a5e0
Update .github/ISSUE_TEMPLATE/bug_report--ldotel.md
kinyoklion c07f7a2
Update .github/ISSUE_TEMPLATE/bug_report--ldotel.md
kinyoklion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: Bug report for the ldotel module | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'ldotel, enhancement' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is this a support request?** | ||
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing support@launchdarkly.com. | ||
|
||
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above. | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To reproduce** | ||
Steps to reproduce the behavior. | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Logs** | ||
If applicable, add any log output related to your problem. | ||
|
||
**SDK version** | ||
The version of this SDK that you are using. | ||
|
||
**Language version, developer tools** | ||
For instance, Go 1.22. | ||
|
||
**OS/platform** | ||
For instance, Ubuntu 16.04, or Windows 10. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request for the ldotel module | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'ldotel, enhancement' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and Test | ||
name: Build and Test SDK | ||
on: | ||
push: | ||
branches: [ 'v7', 'feat/**' ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build and Test ldotel | ||
on: | ||
push: | ||
branches: [ 'v7', 'feat/**' ] | ||
paths-ignore: | ||
- '**.md' # Don't run CI on markdown changes. | ||
pull_request: | ||
branches: [ 'v7', 'feat/**' ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
go-versions: | ||
uses: ./.github/workflows/go-versions.yml | ||
|
||
# Runs the common tasks (unit tests, lint, contract tests) for each Go version. | ||
test-linux: | ||
name: ${{ format('ldotel Linux, Go {0}', matrix.go-version) }} | ||
needs: go-versions | ||
strategy: | ||
# Let jobs fail independently, in case it's a single version that's broken. | ||
fail-fast: false | ||
matrix: | ||
go-version: ${{ fromJSON(needs.go-versions.outputs.matrix) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go ${{ inputs.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: ./.github/actions/unit-tests | ||
with: | ||
lint: 'true' | ||
test-target: ldotel-test | ||
- uses: ./.github/actions/coverage | ||
with: | ||
enforce: 'false' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ go-server-sdk.test | |
allocations.out | ||
.idea | ||
.vscode | ||
go.work | ||
go.work.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
LaunchDarkly Server-side OTEL library for Go | ||
============================================== | ||
[![Actions Status](https://github.com/launchdarkly/go-server-sdk/actions/workflows/ldotel-ci.yml/badge.svg?branch=v7)](https://github.com/launchdarkly/go-server-sdk/actions/workflows/ci.yml) | ||
|
||
LaunchDarkly overview | ||
------------------------- | ||
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today! | ||
|
||
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly) | ||
|
||
Getting started | ||
----------- | ||
|
||
Import the module: | ||
|
||
```go | ||
import ( | ||
"github.com/launchdarkly/go-server-sdk/ldotel" | ||
) | ||
``` | ||
|
||
Configure the LaunchDarkly client to use a tracing hook: | ||
|
||
```go | ||
client, _ = ld.MakeCustomClient("your-sdk-key", | ||
ld.Config{ | ||
Hooks: []ldhooks.Hook{ldotel.NewTracingHook()}, | ||
}, 5*time.Second) | ||
``` | ||
|
||
Learn more | ||
----------- | ||
|
||
Read our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. | ||
|
||
Contributing | ||
------------ | ||
|
||
We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this library. | ||
|
||
About LaunchDarkly | ||
----------- | ||
|
||
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: | ||
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. | ||
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). | ||
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. | ||
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. | ||
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list. | ||
* Explore LaunchDarkly | ||
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information | ||
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides | ||
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation | ||
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the test service? It does not pass linting right now, because it doesn't seem to have accounted for the nested modules not working with
./...
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going with no. We can add it to linting later, but fixing all its lint problems will need a PR as well.