MCPcopy Index your code
hub / github.com/elastic/fleet-server

github.com/elastic/fleet-server @v9.4.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v9.4.3 ↗ · + Follow
2,703 symbols 10,854 edges 296 files 1,171 documented · 43%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Fleet Server

Build status

Fleet server is the control server to manage a fleet of elastic-agents.

Please refer to the official documentation for more details. For production deployments the fleet-server is supervised and bootstrapped by an elastic-agent.

Quick Start

For more detailed instructions see the Developer's Guide.

Requirements

  • Golang see .go-version file for the current supported version.
  • mage, may be installed with the make mage shortcut.

Elasticsearch + Kibana

An Elasticsearch instance is needed in order to run fleet-server. The following environment variables will need to be set with values from Elasticsearch/Kibana in order to run fleet-server:

  • ELASTICSEARCH_HOSTS - The schema://host:port for Elasticsearch.
  • ELASTICSEARCH_CA_TRUSTED_FINGERPRINT - The CA fingerprint for Elasticsearch.
  • ELASTICSEARCH_SERVICE_TOKEN - The fleet-server service token.
  • FLEET_SERVER_POLICY_ID - The fleet policy with the fleet-server integration.

For instructions/options on how to run the Elastic stack please refer to the Developer's Guide.

Build and run

To build the fleet-server binary to run locally use:

mage build:local # Use SNAPSHOT=true if targetting a SNAPSHOT build.

In order to run the fleet-server instance run:

./bin/fleet-server -c fleet-server.yml

Fleet-server should run on port 8220 an can be checked with:

curl -XGET -v http://localhost:8220/api/status

Please note that when running a stand-alone fleet-server instance, it will not appear in Kibana's agents view and another (agent-enrolled) instance may be required in order to the the UI to function as expected. Please refer to the Developer's Guide for more details.

Extension points exported contracts — how you extend this code

Subscription (Interface)
* Design should have the following properties Policy rollout scheduling should... 1) be fair; delivered in first come f [6 …
internal/pkg/policy/monitor.go
Reporter (Interface)
Reporter is interface that reports updated state on. [6 implementers]
internal/pkg/state/reporter.go
Subscription (Interface)
Subscription is a subscription to get notified for new documents. [6 implementers]
internal/pkg/monitor/subscription_monitor.go
BaseMonitor (Interface)
BaseMonitor is the monitor's interface implemented by SimpleMonitor and Monitor [17 implementers]
internal/pkg/monitor/monitor.go
SimpleMonitor (Interface)
SimpleMonitor monitors for new documents in an index. [6 implementers]
internal/pkg/monitor/monitor.go

Core symbols most depended-on inside this repo

Str
called by 345
internal/pkg/file/uploader/jsdict.go
Unmarshal
called by 335
internal/pkg/es/result.go
Set
called by 301
internal/pkg/cache/impl.go
Close
called by 253
internal/pkg/cache/impl.go
Run
called by 240
internal/pkg/policy/monitor.go
Marshal
called by 225
internal/pkg/smap/smap.go
Get
called by 215
internal/pkg/cache/impl.go
Error
called by 169
internal/pkg/es/error.go

Shape

Method 1,136
Function 1,027
Struct 424
TypeAlias 56
FuncType 33
Interface 27

Languages

Go100%

Modules by API surface

internal/pkg/api/openapi.gen.go188 symbols
pkg/api/client.gen.go143 symbols
pkg/api/types.gen.go130 symbols
pkg/api/versions/2023_06_01/api/client.gen.go120 symbols
magefile.go81 symbols
internal/pkg/bulk/schema_easyjson.go54 symbols
internal/pkg/bulk/engine.go54 symbols
pkg/api/versions/2023_06_01/api/types.gen.go42 symbols
internal/pkg/api/handleUpload_test.go36 symbols
internal/pkg/model/schema.go33 symbols
internal/pkg/cache/cache.go33 symbols
testing/e2e/scaffold/scaffold.go31 symbols

For agents

$ claude mcp add fleet-server \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact