Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2c0aaf6
Implement API boilerplate for POST /v1/opamp endpoint
ycombinator Jan 5, 2026
a85ecd1
Add OpAMP section to dev doc
ycombinator Jan 5, 2026
c6c8740
Flesh out dev doc
ycombinator Jan 5, 2026
4aaeffa
Implement basic AgentToServer and ServerToAgent ping pong
ycombinator Jan 5, 2026
3b461de
Implement enrollment
ycombinator Jan 6, 2026
2ca7b0f
Update dev doc to use Fleet enrollment token
ycombinator Jan 6, 2026
1452233
Recording local_metadata
ycombinator Jan 6, 2026
4ea7827
Request components from agents every minute
ycombinator Jan 7, 2026
6b7fac8
Use agent doc
ycombinator Jan 7, 2026
6b44074
Consolidate logic
ycombinator Jan 7, 2026
44d6030
Add feature flag for enabling OpAMP endpoint
ycombinator Feb 3, 2026
43ed72b
Add feature flag to reference config
ycombinator Feb 3, 2026
81e1904
Check feature flag before handing OpAMP requests
ycombinator Feb 3, 2026
f38a1bc
Rename feature flag
ycombinator Feb 3, 2026
0cf3762
Adding unit test for feature flag
ycombinator Feb 3, 2026
98a9578
Address linter errors
ycombinator Feb 4, 2026
a15d749
Allow running specific tests with TEST_RUN env var
ycombinator Feb 4, 2026
2c9dd26
Running mage check:notice
ycombinator Feb 4, 2026
f5a0b4a
Running mage check:headers
ycombinator Feb 4, 2026
0c43b1b
Removing irrelevant file
ycombinator Feb 5, 2026
51f3dff
WIP: Reimplement using opamp-go server package
ycombinator Feb 6, 2026
41da74b
Update spec
ycombinator Feb 6, 2026
4b858d5
Add link to OpAMP spec
ycombinator Feb 6, 2026
3715cfe
Move OpAMP documentation to separate file
ycombinator Feb 6, 2026
1e76756
Remove timer and flags
ycombinator Feb 6, 2026
f06da19
Return instanceUID in response
ycombinator Feb 6, 2026
a05182a
Pass context associated with request
ycombinator Feb 6, 2026
c87b075
Fix env var name in doc
ycombinator Feb 6, 2026
eda3854
Remove error that's no longer needed
ycombinator Feb 6, 2026
84ad494
Set Accept: true on authenticated request
ycombinator Feb 6, 2026
da6c894
Setup some more connection callbacks for debugging
ycombinator Feb 6, 2026
3896ea0
Always return instanceUID in ServerToAgent messages
ycombinator Feb 6, 2026
041f7de
Delegate connection context handling to OpAMP server
ycombinator Feb 6, 2026
614bc27
Update OpAMP feature flag test to use Enabled() method
ycombinator Feb 9, 2026
804bac7
Add rate limiting and metrics for OpAMP route
ycombinator Feb 9, 2026
d991ef8
Update internal/pkg/api/handleOpAMP.go
ycombinator Feb 11, 2026
1421ba6
Update internal/pkg/api/handleOpAMP.go
ycombinator Feb 11, 2026
862ef33
Update internal/pkg/api/handleOpAMP.go
ycombinator Feb 11, 2026
df9cb16
Log when enabling OpAMP endpoint
ycombinator Feb 12, 2026
362a23b
Enable compression on OpAMP server
ycombinator Feb 12, 2026
a838139
Allow up to 3 MB body for OpAMP requests
ycombinator Feb 12, 2026
1f96ce5
Fix missing trailing comma in composite literal
ycombinator Feb 12, 2026
0a75991
Add error logging callbacks to OpAMP connection
ycombinator Feb 12, 2026
0480335
Fix OpAMP enabled log to use zerolog/log package
ycombinator Feb 12, 2026
a6abeb2
Disable HTTP keep-alive for OpAMP requests to fix EOF errors
ycombinator Feb 12, 2026
e0554c4
Handle Elasticsearch 429 rate limit in OpAMP auth
ycombinator Feb 13, 2026
b492246
Increase server idle timeout to 35s for OpAMP compatibility
ycombinator Feb 17, 2026
00f51ad
Use opamp.agent.version instead of agent_version
ycombinator Feb 18, 2026
e7138a4
Consistently use opamp.agent.uid
ycombinator Feb 18, 2026
b107592
Don't log complete AgentToServer or ServerToAgent messages
ycombinator Feb 18, 2026
ab2404f
Remove unused agentMetas field
ycombinator Feb 18, 2026
f587c10
Group imports in handleOpAMP.go
ycombinator Feb 18, 2026
9e72aed
Update doc
ycombinator Feb 18, 2026
58e8428
Use opamp.agent.uid
ycombinator Feb 18, 2026
43e8ecf
Don't log raw data
ycombinator Feb 18, 2026
0f07032
Update idle timeout in unit tests
ycombinator Feb 18, 2026
ea83906
Attach opamp.agent.uid to all logs within handleMessage
ycombinator Feb 19, 2026
854e369
Re-enable keepalives
ycombinator Feb 19, 2026
e6cce32
Undo OpenAPI spec changes
ycombinator Feb 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
724 changes: 484 additions & 240 deletions NOTICE-fips.txt

Large diffs are not rendered by default.

724 changes: 484 additions & 240 deletions NOTICE.txt

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions docs/opamp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# OpAMP

This section describes how to connect a OpenTelemetry Collector instance to Fleet Server over OpAMP.

1. Create a deployment in Elastic Cloud. Integrations Server is not needed as we will instead be
using the Fleet Server instance built from this repository so it can "speak" OpAMP to the OpenTelemetry
Collector.
2. Create an Elasticsearch service account token using Kibana > Dev Tools > Console.
```
POST /_security/service/elastic/fleet-server/credential/token/opamp
```
3. Enable the OpAMP feature flag in the `fleet-server.yml` file by adding the following snippet to the `fleet-server` input
section, as a sibling of the `policy.id` key:
```yml
server:
feature_flags:
enable_opamp: true
```

4. Build the Fleet Server binary for your platform.
```
mage build:local
```
5. Run the Fleet Server binary with the above configuration.
```
./bin/fleet-server
```
6. Create a new policy in Fleet. Copy the enrollment token for that policy.
7. Create OpenTelemetry Collector configuration for connecting to the Fleet Server instance and save it as `otel-opamp.yaml`.
```yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

exporters:
debug:
verbosity: detailed

extensions:
opamp:
server:
http:
endpoint: http://localhost:8220/v1/opamp
tls:
insecure: true
headers:
Authorization: ApiKey ${env:FLEET_ENROLLMENT_TOKEN}
instance_uid: "019b8d7a-2da8-7657-b52d-492a9de33319"

service:
pipelines:
logs:
receivers: [otlp]
exporters: [debug]
extensions: [opamp]
```
7. Download and extract an OpenTelemetry Collector Contrib release for your platform from https://github.com/open-telemetry/opentelemetry-collector-releases/releases
8. Run the OpenTelemetry Collector with the above configuration.
```
API_KEY=<enrollment token> ./otelcol-contrib --config ./otel-opamp.yaml
```
3 changes: 3 additions & 0 deletions fleet-server.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ fleet:
# // POLICY_CHANGE actions need an explicit ack if this is set.
# ignore_checkin_policy_id: false
#
# // enable OpAMP endpoint
# enable_opamp: false
#
# # monitor options are advanced configuration and should not be adjusted is most cases
# monitor:
# fetch_size: 1000 # The number of documents that each monitor may fetch at once
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
github.com/mailru/easyjson v0.9.1
github.com/miolini/datacounter v1.0.3
github.com/oapi-codegen/runtime v1.1.2
github.com/open-telemetry/opamp-go v0.22.0
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/prometheus/client_golang v1.23.2
github.com/rs/xid v1.6.0
Expand All @@ -36,6 +37,7 @@ require (
go.elastic.co/apm/module/apmzerolog/v2 v2.7.3
go.elastic.co/apm/v2 v2.7.3
go.elastic.co/ecszerolog v0.2.0
go.opentelemetry.io/otel v1.39.0
go.uber.org/zap v1.27.1
golang.org/x/net v0.50.0
golang.org/x/sync v0.19.0
Expand Down Expand Up @@ -63,6 +65,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
Expand All @@ -87,7 +90,6 @@ require (
go.elastic.co/ecszap v1.0.3 // indirect
go.elastic.co/fastjson v1.5.1 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.39.0 // indirect
go.opentelemetry.io/otel/metric v1.39.0 // indirect
go.opentelemetry.io/otel/trace v1.39.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ github.com/google/pprof v0.0.0-20230426061923-93006964c1fc h1:AGDHt781oIcL4EFk7c
github.com/google/pprof v0.0.0-20230426061923-93006964c1fc/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-version v1.8.0 h1:KAkNb1HAiZd1ukkxDFGmokVZe1Xy9HG6NUp+bPle2i4=
Expand Down Expand Up @@ -123,6 +125,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI=
github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/open-telemetry/opamp-go v0.22.0 h1:7UnsQgFFS7ffM09JQk+9aGVBAAlsLfcooZ9xvSYwxWM=
github.com/open-telemetry/opamp-go v0.22.0/go.mod h1:339N71soCPrhHywbAcKUZJDODod581ZOxCpTkrl3zYQ=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
Expand Down
7 changes: 7 additions & 0 deletions internal/pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ func WithStatus(st *StatusT) APIOpt {
}
}

func WithOpAMP(oa *OpAMPT) APIOpt {
return func(a *apiServer) {
a.oa = oa
}
}

func WithUpload(ut *UploadT) APIOpt {
return func(a *apiServer) {
a.ut = ut
Expand Down Expand Up @@ -84,6 +90,7 @@ type apiServer struct {
at *ArtifactT
ack *AckT
st *StatusT
oa *OpAMPT
ut *UploadT
ft *FileDeliveryT
pt *PGPRetrieverT
Expand Down
Loading