Skip to content

Commit 2ee3974

Browse files
committed
chore: README
1 parent 16f46f8 commit 2ee3974

File tree

3 files changed

+344
-2
lines changed

3 files changed

+344
-2
lines changed

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing to OpenLLMetry-JS
2+
3+
Thanks for taking the time to contribute! 😃 🚀
4+
5+
Please refer to our [Contributing Guide](https://traceloop.com/docs/openllmetry/contributing/overview) for instructions on how to contribute.
6+
7+
## Releasing
8+
9+
To release a new version of the package, run (make sure you have access to the `@traceloop` npm organization):
10+
11+
```bash
12+
nx run-many --targets=build
13+
npx lerna publish --no-private
14+
```

README.md

Lines changed: 202 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,202 @@
1-
# go-openllmetry
2-
Sister project to OpenLLMetry, but in Go. Open-source observability for your LLM application, based on OpenTelemetry
1+
<p align="center">
2+
<a href="https://www.traceloop.com/openllmetry#gh-light-mode-only">
3+
<img width="600" src="https://raw.githubusercontent.com/traceloop/openllmetry/main/img/logo-light.png">
4+
</a>
5+
<a href="https://www.traceloop.com/openllmetry#gh-dark-mode-only">
6+
<img width="600" src="https://raw.githubusercontent.com/traceloop/openllmetry/main/img/logo-dark.png">
7+
</a>
8+
</p>
9+
<h1 align="center">For Go</h1>
10+
<p align="center">
11+
<p align="center">Open-source observability for your LLM application</p>
12+
</p>
13+
<h4 align="center">
14+
<a href="https://traceloop.com/docs/openllmetry/getting-started-go"><strong>Get started »</strong></a>
15+
<br />
16+
<br />
17+
<a href="https://traceloop.com/slack">Slack</a> |
18+
<a href="https://traceloop.com/docs/openllmetry/introduction">Docs</a> |
19+
<a href="https://www.traceloop.com">Website</a>
20+
</h4>
21+
22+
<h4 align="center">
23+
<a href="https://github.com/traceloop/go-openllmetry/blob/main/LICENSE">
24+
<img src="https://img.shields.io/badge/license-Apache 2.0-blue.svg" alt="OpenLLMetry is released under the Apache-2.0 License">
25+
</a>
26+
<a href="https://www.ycombinator.com/companies/traceloop"><img src="https://img.shields.io/website?color=%23f26522&down_message=Y%20Combinator&label=Backed&logo=ycombinator&style=flat-square&up_message=Y%20Combinator&url=https%3A%2F%2Fwww.ycombinator.com"></a>
27+
<a href="https://github.com/traceloop/go-openllmetry/blob/main/CONTRIBUTING.md">
28+
<img src="https://img.shields.io/badge/PRs-Welcome-brightgreen" alt="PRs welcome!" />
29+
</a>
30+
<a href="https://github.com/traceloop/go-openllmetry/issues">
31+
<img src="https://img.shields.io/github/commit-activity/m/traceloop/go-openllmetry" alt="git commit activity" />
32+
</a>
33+
<a href="https://traceloop.com/slack">
34+
<img src="https://img.shields.io/badge/chat-on%20Slack-blueviolet" alt="Slack community channel" />
35+
</a>
36+
<a href="https://twitter.com/traceloopdev">
37+
<img src="https://img.shields.io/badge/follow-%40traceloopdev-1DA1F2?logo=twitter&style=social" alt="Traceloop Twitter" />
38+
</a>
39+
</h4>
40+
41+
OpenLLMetry is a set of extensions built on top of [OpenTelemetry](https://opentelemetry.io/) that gives you complete observability over your LLM application. Because it uses OpenTelemetry under the hood, it can be connected to your existing observability solutions - Datadog, Honeycomb, and others.
42+
43+
It's built and maintained by Traceloop under the Apache 2.0 license.
44+
45+
The repo contains standard OpenTelemetry instrumentations for LLM providers and Vector DBs, as well as a Traceloop SDK that makes it easy to get started with OpenLLMetry, while still outputting standard OpenTelemetry data that can be connected to your observability stack.
46+
If you already have OpenTelemetry instrumented, you can just add any of our instrumentations directly.
47+
48+
## 🚀 Getting Started
49+
50+
The easiest way to get started is to use our SDK.
51+
For a complete guide, go to our [docs](https://traceloop.com/docs/openllmetry/getting-started-go).
52+
53+
Install the SDK:
54+
55+
```bash
56+
go get traceloop-sdk
57+
```
58+
59+
Then, initialize the SDK in your code:
60+
61+
```go
62+
package main
63+
64+
import (
65+
"context"
66+
67+
sdk "github.com/traceloop/go-openllmetry/traceloop-sdk"
68+
"github.com/traceloop/go-openllmetry/traceloop-sdk/config"
69+
)
70+
71+
func main() {
72+
ctx := context.Background()
73+
74+
traceloop := sdk.NewClient(config.Config{
75+
BaseURL: "api.traceloop.com",
76+
APIKey: os.Getenv("TRACELOOP_API_KEY"),
77+
})
78+
defer func() { traceloop.Shutdown(ctx) }()
79+
80+
traceloop.Initialize(ctx)
81+
}
82+
```
83+
84+
That's it. You're now tracing your code with OpenLLMetry!
85+
86+
Now, you need to decide where to export the traces to.
87+
88+
## ⏫ Supported (and tested) destinations
89+
90+
- [x] [Traceloop](https://www.traceloop.com/docs/openllmetry/integrations/traceloop)
91+
- [x] [Dynatrace](https://www.traceloop.com/docs/openllmetry/integrations/dynatrace)
92+
- [x] [Datadog](https://www.traceloop.com/docs/openllmetry/integrations/datadog)
93+
- [x] [New Relic](https://www.traceloop.com/docs/openllmetry/integrations/newrelic)
94+
- [x] [Honeycomb](https://www.traceloop.com/docs/openllmetry/integrations/honeycomb)
95+
- [x] [Grafana Tempo](https://www.traceloop.com/docs/openllmetry/integrations/grafana)
96+
- [x] [HyperDX](https://www.traceloop.com/docs/openllmetry/integrations/hyperdx)
97+
- [x] [SigNoz](https://www.traceloop.com/docs/openllmetry/integrations/signoz)
98+
- [x] [OpenTelemetry Collector](https://www.traceloop.com/docs/openllmetry/integrations/otel-collector)
99+
100+
See [our docs](https://traceloop.com/docs/openllmetry/integrations/exporting) for instructions on connecting to each one.
101+
102+
## 🪗 What do we instrument?
103+
104+
OpenLLMetry is in early-alpha exploratory stage, and we're still figuring out what to instrument.
105+
As opposed to other languages, there aren't many official LLM libraries (yet?), so for now you'll have to manually log prompts:
106+
107+
```go
108+
package main
109+
110+
import (
111+
"context"
112+
"fmt"
113+
"os"
114+
115+
"github.com/sashabaranov/go-openai"
116+
sdk "github.com/traceloop/go-openllmetry/traceloop-sdk"
117+
"github.com/traceloop/go-openllmetry/traceloop-sdk/config"
118+
"github.com/traceloop/go-openllmetry/traceloop-sdk/dto"
119+
)
120+
121+
func main() {
122+
ctx := context.Background()
123+
124+
// Initialize Traceloop
125+
traceloop := sdk.NewClient(config.Config{
126+
BaseURL: "api.traceloop.com",
127+
APIKey: os.Getenv("TRACELOOP_API_KEY"),
128+
})
129+
defer func() { traceloop.Shutdown(ctx) }()
130+
131+
traceloop.Initialize(ctx)
132+
133+
// Call OpenAI like you normally would
134+
resp, err := client.CreateChatCompletion(
135+
context.Background(),
136+
openai.ChatCompletionRequest{
137+
Model: openai.GPT3Dot5Turbo,
138+
Messages: []openai.ChatCompletionMessage{
139+
{
140+
Role: openai.ChatMessageRoleUser,
141+
Content: "Tell me a joke about OpenTelemetry!",
142+
},
143+
},
144+
},
145+
)
146+
147+
// Log the request and the response
148+
log := dto.PromptLogAttributes{
149+
Prompt: dto.Prompt{
150+
Vendor: "openai",
151+
Mode: "chat",
152+
Model: request.Model,
153+
},
154+
Completion: dto.Completion{
155+
Model: resp.Model,
156+
},
157+
Usage: dto.Usage{
158+
TotalTokens: resp.Usage.TotalTokens,
159+
CompletionTokens: resp.Usage.CompletionTokens,
160+
PromptTokens: resp.Usage.PromptTokens,
161+
},
162+
}
163+
164+
for i, message := range request.Messages {
165+
log.Prompt.Messages = append(log.Prompt.Messages, dto.Message{
166+
Index: i,
167+
Content: message.Content,
168+
Role: message.Role,
169+
})
170+
}
171+
172+
for _, choice := range resp.Choices {
173+
log.Completion.Messages = append(log.Completion.Messages, dto.Message{
174+
Index: choice.Index,
175+
Content: choice.Message.Content,
176+
Role: choice.Message.Role,
177+
})
178+
}
179+
180+
traceloop.LogPrompt(ctx, log)
181+
}
182+
```
183+
184+
## 🌱 Contributing
185+
186+
Whether it's big or small, we love contributions ❤️ Check out our guide to see how to [get started](https://traceloop.com/docs/openllmetry/contributing/overview).
187+
188+
Not sure where to get started? You can:
189+
190+
- [Book a free pairing session with one of our teammates](mailto:[email protected]?subject=Pairing%20session&body=I'd%20like%20to%20do%20a%20pairing%20session!)!
191+
- Join our <a href="https://join.slack.com/t/traceloopcommunity/shared_invite/zt-1plpfpm6r-zOHKI028VkpcWdobX65C~g">Slack</a>, and ask us any questions there.
192+
193+
## 💚 Community & Support
194+
195+
- [Slack](https://join.slack.com/t/traceloopcommunity/shared_invite/zt-1plpfpm6r-zOHKI028VkpcWdobX65C~g) (For live discussion with the community and the Traceloop team)
196+
- [GitHub Discussions](https://github.com/traceloop/go-openllmetry/discussions) (For help with building and deeper conversations about features)
197+
- [GitHub Issues](https://github.com/traceloop/go-openllmetry/issues) (For any bugs and errors you encounter using OpenLLMetry)
198+
- [Twitter](https://twitter.com/traceloopdev) (Get news fast)
199+
200+
## 🙏 Special Thanks
201+
202+
To @patrickdebois, who [suggested the great name](https://x.com/patrickdebois/status/1695518950715473991?s=46&t=zn2SOuJcSVq-Pe2Ysevzkg) we're now using for this repo!

0 commit comments

Comments
 (0)