https://github.com/hedon954/goapm
go apm is a set of wrapping common tools with open telemetry components, like redis, mysql, http, gin, gorm and so on.
https://github.com/hedon954/goapm
apm elasticsearch go golang grafana kibana log metric mysql opentelemetry opentelemetry-go otel otel-collector prometheus redis trace
Last synced: 15 days ago
JSON representation
go apm is a set of wrapping common tools with open telemetry components, like redis, mysql, http, gin, gorm and so on.
- Host: GitHub
- URL: https://github.com/hedon954/goapm
- Owner: hedon954
- License: mit
- Created: 2024-10-25T03:15:51.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T03:12:48.000Z (6 months ago)
- Last Synced: 2024-11-11T04:19:23.169Z (6 months ago)
- Topics: apm, elasticsearch, go, golang, grafana, kibana, log, metric, mysql, opentelemetry, opentelemetry-go, otel, otel-collector, prometheus, redis, trace
- Language: Go
- Homepage:
- Size: 231 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# goapm
[](https://goreportcard.com/report/github.com/hedon954/goapm)
[](https://codecov.io/github/hedon954/goapm)
[](https://github.com/hedon954/goapm/actions)
[](https://github.com/hedon954/goapm/releases)
[](https://pkg.go.dev/github.com/hedon954/goapm)`goapm` is a toolkit for monitoring and observability of golang applications. It provides a set of libraries that are wrapped around `opentelemetry`.
## Example
- [goapm-example](https://github.com/hedon954/goapm-example)
## Features
- [x] Components support `opentelemetry`
- [x] sql.DB
- [x] gorm.DB
- [x] RedisV6
- [x] RedisV9
- [x] HTTP
- [x] Gin
- [x] GRPC Server
- [x] GRPC Client
- [x] Metrics
- [x] AutoPProf
- [x] APM
- [x] RotateLog## Architecture

## Otel Collector Policy
```yaml
processors:
batch:
tail_sampling:
decision_wait: 5s
num_traces: 50000
expected_new_traces_per_sec: 1
policies:
[
{
name: "pinned-always-sample",
type: boolean_attribute,
boolean_attribute: { key: pinned, value: true },
},
{
name: "error-always-sample",
type: boolean_attribute,
boolean_attribute: { key: error, value: true },
},
{
name: "slowsql-always-sample",
type: boolean_attribute,
boolean_attribute: { key: slowsql, value: true },
},
{
name: "longtx-always-sample",
type: boolean_attribute,
boolean_attribute: { key: longtx, value: true },
},
{
name: http-slow,
type: numeric_attribute,
numeric_attribute:
{
key: http.duration_ms,
min_value: 1000,
max_value: 9223372036854775807,
},
},
{
name: http-status-error,
type: numeric_attribute,
numeric_attribute:
{ key: http.status_code, min_value: 500, max_value: 599 },
},
{
name: grpc-slow,
type: numeric_attribute,
numeric_attribute:
{
key: grpc.duration_ms,
min_value: 1000,
max_value: 9223372036854775807,
},
},
]
filter/ottl:
error_mode: ignore
traces:
span:
- 'attributes["drop"] == true'
```