├── .dockerignore ├── .drone ├── README.md ├── drone.jsonnet ├── drone.yml ├── pipelines │ ├── build_images.jsonnet │ ├── check_containers.jsonnet │ ├── crosscompile.jsonnet │ ├── publish.jsonnet │ ├── test.jsonnet │ └── test_packages.jsonnet └── util │ ├── build_image.jsonnet │ ├── pipelines.jsonnet │ └── secrets.jsonnet ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yaml │ ├── config.yml │ ├── feature_request.yaml │ └── proposal.yaml ├── depcheck.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── autolock.yml │ ├── backport.yml │ ├── bump-formula-pr.yml │ ├── check-linux-build-image.yml │ ├── check-versioned-files.yml │ ├── check-windows-build-image.yml │ ├── check_docs.yml │ ├── depcheck.yml │ ├── helm-release.yml │ ├── helm-test.yml │ ├── integration-tests.yml │ ├── needs-attention.yml │ ├── publish-documentation-next.yml │ ├── publish-technical-documentation-release.yml │ ├── scripts.yml │ ├── snyk.yml │ ├── test.yml │ ├── trivy.yml │ └── update-make-docs.yml ├── .gitignore ├── .golangci.yml ├── ADOPTERS.md ├── CHANGELOG.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── GOVERNANCE.md ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── README.md ├── SECURITY.md ├── build-image ├── Dockerfile ├── README.md └── windows │ └── Dockerfile ├── cmd ├── grafana-agent-flow │ └── main.go ├── grafana-agent-operator │ ├── DEVELOPERS.md │ ├── Dockerfile │ ├── README.md │ ├── agent-example-config.yaml │ ├── example-grafana.yaml │ ├── example-loki.yaml │ ├── example-prometheus.yaml │ └── main.go ├── grafana-agent-service │ ├── config_windows.go │ ├── doc.go │ ├── logger_windows.go │ ├── main_windows.go │ ├── service.go │ ├── service_test.go │ └── testdata │ │ └── example_service.go ├── grafana-agent │ ├── Dockerfile │ ├── Dockerfile.windows │ ├── agent-local-config.yaml │ ├── entrypoint.go │ ├── example-config.river │ ├── main.go │ ├── mode.go │ ├── run-config.river │ ├── service.go │ └── service_windows.go └── grafana-agentctl │ ├── Dockerfile │ ├── Dockerfile.windows │ └── main.go ├── docs ├── Makefile ├── README.md ├── developer │ ├── contributing.md │ ├── release │ │ ├── 0-ensure-otel-dep-updated.md │ │ ├── 1-create-release-branch.md │ │ ├── 10-announce-release.md │ │ ├── 11-update-otel.md │ │ ├── 2-cherry-pick-commits.md │ │ ├── 3-update-version-in-code.md │ │ ├── 4-tag-release.md │ │ ├── 6-publish-release.md │ │ ├── 7-test-release.md │ │ ├── 8-update-helm-charts.md │ │ ├── 9-update-homebrew.md │ │ ├── README.md │ │ └── concepts │ │ │ └── version.md │ ├── updating-go.md │ ├── updating-otel.md │ ├── windows │ │ └── certificate_store │ │ │ ├── README.md │ │ │ └── images │ │ │ ├── additional_services.png │ │ │ ├── addroles.png │ │ │ ├── any_purpose.png │ │ │ ├── availability.png │ │ │ ├── certificate_authority_click.png │ │ │ ├── certificate_templates.png │ │ │ ├── certificateservices.png │ │ │ ├── common_name.png │ │ │ ├── config.png │ │ │ ├── configure_certificate_authority.png │ │ │ ├── default_certificate.png │ │ │ ├── default_identity.png │ │ │ ├── default_private_ky.png │ │ │ ├── enterprise_ca.png │ │ │ ├── export_private_key.png │ │ │ ├── exportable_key.png │ │ │ ├── give_control.png │ │ │ ├── initial.png │ │ │ ├── manage.png │ │ │ ├── new_cert.png │ │ │ ├── new_cert_exportable.png │ │ │ ├── object_identifier.png │ │ │ ├── private_key.png │ │ │ ├── root_ca.png │ │ │ ├── template_general.png │ │ │ └── validity.png │ ├── writing-docs.md │ ├── writing-exporter-flow-components.md │ └── writing-flow-component-documentation.md ├── docs.mk ├── make-docs ├── rfcs │ ├── 0000-template.md │ ├── 0001-designing-in-the-open.md │ ├── 0002-integrations-in-operator.md │ ├── 0003-new-metrics-subsystem.md │ ├── 0004-agent-flow.md │ ├── 0005-river.md │ ├── 0006-clustering.md │ ├── 0006-future-of-agent-operator.md │ ├── 0007-flow-modules.md │ └── 0008-backwards-compatibility.md ├── sources │ ├── _index.md │ ├── _index.md.t │ ├── about.md │ ├── assets │ │ ├── hierarchy.svg │ │ ├── logo_and_name.png │ │ ├── tasks │ │ │ ├── loki-config.png │ │ │ ├── otlp-lgtm-graph.png │ │ │ ├── prometheus-config.png │ │ │ └── tempo-config.png │ │ ├── ui_clustering_page.png │ │ ├── ui_component_detail_page.png │ │ ├── ui_graph_page.png │ │ └── ui_home_page.png │ ├── data-collection.md │ ├── flow │ │ ├── _index.md │ │ ├── concepts │ │ │ ├── _index.md │ │ │ ├── clustering.md │ │ │ ├── component_controller.md │ │ │ ├── components.md │ │ │ ├── config-language │ │ │ │ ├── _index.md │ │ │ │ ├── components.md │ │ │ │ ├── expressions │ │ │ │ │ ├── _index.md │ │ │ │ │ ├── function_calls.md │ │ │ │ │ ├── operators.md │ │ │ │ │ ├── referencing_exports.md │ │ │ │ │ └── types_and_values.md │ │ │ │ ├── files.md │ │ │ │ └── syntax.md │ │ │ ├── custom_components.md │ │ │ └── modules.md │ │ ├── get-started │ │ │ ├── _index.md │ │ │ ├── deploy-agent.md │ │ │ ├── install │ │ │ │ ├── _index.md │ │ │ │ ├── ansible.md │ │ │ │ ├── binary.md │ │ │ │ ├── chef.md │ │ │ │ ├── docker.md │ │ │ │ ├── kubernetes.md │ │ │ │ ├── linux.md │ │ │ │ ├── macos.md │ │ │ │ ├── puppet.md │ │ │ │ └── windows.md │ │ │ └── run │ │ │ │ ├── _index.md │ │ │ │ ├── binary.md │ │ │ │ ├── linux.md │ │ │ │ ├── macos.md │ │ │ │ └── windows.md │ │ ├── reference │ │ │ ├── _index.md │ │ │ ├── cli │ │ │ │ ├── _index.md │ │ │ │ ├── convert.md │ │ │ │ ├── fmt.md │ │ │ │ ├── run.md │ │ │ │ └── tools.md │ │ │ ├── compatibility │ │ │ │ └── _index.md │ │ │ ├── components │ │ │ │ ├── _index.md │ │ │ │ ├── discovery.azure.md │ │ │ │ ├── discovery.consul.md │ │ │ │ ├── discovery.consulagent.md │ │ │ │ ├── discovery.digitalocean.md │ │ │ │ ├── discovery.dns.md │ │ │ │ ├── discovery.docker.md │ │ │ │ ├── discovery.dockerswarm.md │ │ │ │ ├── discovery.ec2.md │ │ │ │ ├── discovery.eureka.md │ │ │ │ ├── discovery.file.md │ │ │ │ ├── discovery.gce.md │ │ │ │ ├── discovery.hetzner.md │ │ │ │ ├── discovery.http.md │ │ │ │ ├── discovery.ionos.md │ │ │ │ ├── discovery.kubelet.md │ │ │ │ ├── discovery.kubernetes.md │ │ │ │ ├── discovery.kuma.md │ │ │ │ ├── discovery.lightsail.md │ │ │ │ ├── discovery.linode.md │ │ │ │ ├── discovery.marathon.md │ │ │ │ ├── discovery.nerve.md │ │ │ │ ├── discovery.nomad.md │ │ │ │ ├── discovery.openstack.md │ │ │ │ ├── discovery.ovhcloud.md │ │ │ │ ├── discovery.process.md │ │ │ │ ├── discovery.puppetdb.md │ │ │ │ ├── discovery.relabel.md │ │ │ │ ├── discovery.scaleway.md │ │ │ │ ├── discovery.serverset.md │ │ │ │ ├── discovery.triton.md │ │ │ │ ├── discovery.uyuni.md │ │ │ │ ├── faro.receiver.md │ │ │ │ ├── local.file.md │ │ │ │ ├── local.file_match.md │ │ │ │ ├── loki.echo.md │ │ │ │ ├── loki.process.md │ │ │ │ ├── loki.relabel.md │ │ │ │ ├── loki.rules.kubernetes.md │ │ │ │ ├── loki.source.api.md │ │ │ │ ├── loki.source.awsfirehose.md │ │ │ │ ├── loki.source.azure_event_hubs.md │ │ │ │ ├── loki.source.cloudflare.md │ │ │ │ ├── loki.source.docker.md │ │ │ │ ├── loki.source.file.md │ │ │ │ ├── loki.source.gcplog.md │ │ │ │ ├── loki.source.gelf.md │ │ │ │ ├── loki.source.heroku.md │ │ │ │ ├── loki.source.journal.md │ │ │ │ ├── loki.source.kafka.md │ │ │ │ ├── loki.source.kubernetes.md │ │ │ │ ├── loki.source.kubernetes_events.md │ │ │ │ ├── loki.source.podlogs.md │ │ │ │ ├── loki.source.syslog.md │ │ │ │ ├── loki.source.windowsevent.md │ │ │ │ ├── loki.write.md │ │ │ │ ├── mimir.rules.kubernetes.md │ │ │ │ ├── module.file.md │ │ │ │ ├── module.git.md │ │ │ │ ├── module.http.md │ │ │ │ ├── module.string.md │ │ │ │ ├── otelcol.auth.basic.md │ │ │ │ ├── otelcol.auth.bearer.md │ │ │ │ ├── otelcol.auth.headers.md │ │ │ │ ├── otelcol.auth.oauth2.md │ │ │ │ ├── otelcol.auth.sigv4.md │ │ │ │ ├── otelcol.connector.host_info.md │ │ │ │ ├── otelcol.connector.servicegraph.md │ │ │ │ ├── otelcol.connector.spanlogs.md │ │ │ │ ├── otelcol.connector.spanmetrics.md │ │ │ │ ├── otelcol.exporter.debug.md │ │ │ │ ├── otelcol.exporter.loadbalancing.md │ │ │ │ ├── otelcol.exporter.logging.md │ │ │ │ ├── otelcol.exporter.loki.md │ │ │ │ ├── otelcol.exporter.otlp.md │ │ │ │ ├── otelcol.exporter.otlphttp.md │ │ │ │ ├── otelcol.exporter.prometheus.md │ │ │ │ ├── otelcol.extension.jaeger_remote_sampling.md │ │ │ │ ├── otelcol.processor.attributes.md │ │ │ │ ├── otelcol.processor.batch.md │ │ │ │ ├── otelcol.processor.discovery.md │ │ │ │ ├── otelcol.processor.filter.md │ │ │ │ ├── otelcol.processor.k8sattributes.md │ │ │ │ ├── otelcol.processor.memory_limiter.md │ │ │ │ ├── otelcol.processor.probabilistic_sampler.md │ │ │ │ ├── otelcol.processor.resourcedetection.md │ │ │ │ ├── otelcol.processor.span.md │ │ │ │ ├── otelcol.processor.tail_sampling.md │ │ │ │ ├── otelcol.processor.transform.md │ │ │ │ ├── otelcol.receiver.jaeger.md │ │ │ │ ├── otelcol.receiver.kafka.md │ │ │ │ ├── otelcol.receiver.loki.md │ │ │ │ ├── otelcol.receiver.opencensus.md │ │ │ │ ├── otelcol.receiver.otlp.md │ │ │ │ ├── otelcol.receiver.prometheus.md │ │ │ │ ├── otelcol.receiver.vcenter.md │ │ │ │ ├── otelcol.receiver.zipkin.md │ │ │ │ ├── prometheus.exporter.apache.md │ │ │ │ ├── prometheus.exporter.azure.md │ │ │ │ ├── prometheus.exporter.blackbox.md │ │ │ │ ├── prometheus.exporter.cadvisor.md │ │ │ │ ├── prometheus.exporter.cloudwatch.md │ │ │ │ ├── prometheus.exporter.consul.md │ │ │ │ ├── prometheus.exporter.dnsmasq.md │ │ │ │ ├── prometheus.exporter.elasticsearch.md │ │ │ │ ├── prometheus.exporter.gcp.md │ │ │ │ ├── prometheus.exporter.github.md │ │ │ │ ├── prometheus.exporter.kafka.md │ │ │ │ ├── prometheus.exporter.memcached.md │ │ │ │ ├── prometheus.exporter.mongodb.md │ │ │ │ ├── prometheus.exporter.mssql.md │ │ │ │ ├── prometheus.exporter.mysql.md │ │ │ │ ├── prometheus.exporter.oracledb.md │ │ │ │ ├── prometheus.exporter.postgres.md │ │ │ │ ├── prometheus.exporter.process.md │ │ │ │ ├── prometheus.exporter.redis.md │ │ │ │ ├── prometheus.exporter.self.md │ │ │ │ ├── prometheus.exporter.snmp.md │ │ │ │ ├── prometheus.exporter.snowflake.md │ │ │ │ ├── prometheus.exporter.squid.md │ │ │ │ ├── prometheus.exporter.statsd.md │ │ │ │ ├── prometheus.exporter.unix.md │ │ │ │ ├── prometheus.exporter.vsphere.md │ │ │ │ ├── prometheus.exporter.windows.md │ │ │ │ ├── prometheus.operator.podmonitors.md │ │ │ │ ├── prometheus.operator.probes.md │ │ │ │ ├── prometheus.operator.servicemonitors.md │ │ │ │ ├── prometheus.receive_http.md │ │ │ │ ├── prometheus.relabel.md │ │ │ │ ├── prometheus.remote_write.md │ │ │ │ ├── prometheus.scrape.md │ │ │ │ ├── pyroscope.ebpf.md │ │ │ │ ├── pyroscope.java.md │ │ │ │ ├── pyroscope.scrape.md │ │ │ │ ├── pyroscope.write.md │ │ │ │ ├── remote.http.md │ │ │ │ ├── remote.kubernetes.configmap.md │ │ │ │ ├── remote.kubernetes.secret.md │ │ │ │ ├── remote.s3.md │ │ │ │ └── remote.vault.md │ │ │ ├── config-blocks │ │ │ │ ├── _index.md │ │ │ │ ├── argument.md │ │ │ │ ├── declare.md │ │ │ │ ├── export.md │ │ │ │ ├── http.md │ │ │ │ ├── import.file.md │ │ │ │ ├── import.git.md │ │ │ │ ├── import.http.md │ │ │ │ ├── import.string.md │ │ │ │ ├── logging.md │ │ │ │ ├── remotecfg.md │ │ │ │ └── tracing.md │ │ │ └── stdlib │ │ │ │ ├── _index.md │ │ │ │ ├── coalesce.md │ │ │ │ ├── concat.md │ │ │ │ ├── constants.md │ │ │ │ ├── env.md │ │ │ │ ├── format.md │ │ │ │ ├── join.md │ │ │ │ ├── json_decode.md │ │ │ │ ├── json_path.md │ │ │ │ ├── nonsensitive.md │ │ │ │ ├── replace.md │ │ │ │ ├── split.md │ │ │ │ ├── to_lower.md │ │ │ │ ├── to_upper.md │ │ │ │ ├── trim.md │ │ │ │ ├── trim_prefix.md │ │ │ │ ├── trim_space.md │ │ │ │ └── trim_suffix.md │ │ ├── release-notes.md │ │ ├── tasks │ │ │ ├── _index.md │ │ │ ├── collect-opentelemetry-data.md │ │ │ ├── collect-prometheus-metrics.md │ │ │ ├── configure-agent-clustering.md │ │ │ ├── configure │ │ │ │ ├── _index.md │ │ │ │ ├── configure-kubernetes.md │ │ │ │ ├── configure-linux.md │ │ │ │ ├── configure-macos.md │ │ │ │ └── configure-windows.md │ │ │ ├── debug.md │ │ │ ├── distribute-prometheus-scrape-load.md │ │ │ ├── estimate-resource-usage.md │ │ │ ├── metamonitoring.md │ │ │ ├── migrate │ │ │ │ ├── _index.md │ │ │ │ ├── from-operator.md │ │ │ │ ├── from-otelcol.md │ │ │ │ ├── from-prometheus.md │ │ │ │ ├── from-promtail.md │ │ │ │ └── from-static.md │ │ │ ├── monitor │ │ │ │ ├── _index.md │ │ │ │ ├── component_metrics.md │ │ │ │ └── controller_metrics.md │ │ │ └── opentelemetry-to-lgtm-stack.md │ │ └── tutorials │ │ │ ├── _index.md │ │ │ ├── assets │ │ │ ├── docker-compose.yaml │ │ │ ├── flow_configs │ │ │ │ ├── agent.river │ │ │ │ ├── example.river │ │ │ │ ├── multiple-inputs.river │ │ │ │ └── relabel.river │ │ │ ├── generate.sh │ │ │ ├── grafana │ │ │ │ ├── config │ │ │ │ │ └── grafana.ini │ │ │ │ ├── dashboards-provisioning │ │ │ │ │ └── dashboards.yaml │ │ │ │ ├── dashboards │ │ │ │ │ ├── agent.json │ │ │ │ │ └── template.jsonnet │ │ │ │ └── datasources │ │ │ │ │ └── datasource.yml │ │ │ ├── mimir │ │ │ │ └── mimir.yaml │ │ │ └── runt.sh │ │ │ ├── chaining.md │ │ │ ├── collecting-prometheus-metrics.md │ │ │ ├── filtering-metrics.md │ │ │ └── flow-by-example │ │ │ ├── _index.md │ │ │ ├── first-components-and-stdlib │ │ │ └── index.md │ │ │ ├── get-started.md │ │ │ ├── logs-and-relabeling-basics │ │ │ └── index.md │ │ │ └── processing-logs │ │ │ └── index.md │ ├── operator │ │ ├── _index.md │ │ ├── add-custom-scrape-jobs.md │ │ ├── api.md │ │ ├── architecture.md │ │ ├── deploy-agent-operator-resources.md │ │ ├── getting-started.md │ │ ├── helm-getting-started.md │ │ ├── hierarchy.dot │ │ ├── operator-integrations.md │ │ └── release-notes.md │ ├── shared │ │ ├── deploy-agent.md │ │ ├── flow │ │ │ ├── reference │ │ │ │ └── components │ │ │ │ │ ├── authorization-block.md │ │ │ │ │ ├── azuread-block.md │ │ │ │ │ ├── basic-auth-block.md │ │ │ │ │ ├── exporter-component-exports.md │ │ │ │ │ ├── extract-field-block.md │ │ │ │ │ ├── field-filter-block.md │ │ │ │ │ ├── http-client-config-block.md │ │ │ │ │ ├── http-client-proxy-config-description.md │ │ │ │ │ ├── local-file-arguments-text.md │ │ │ │ │ ├── loki-server-grpc.md │ │ │ │ │ ├── loki-server-http.md │ │ │ │ │ ├── managed_identity-block.md │ │ │ │ │ ├── match-properties-block.md │ │ │ │ │ ├── oauth2-block.md │ │ │ │ │ ├── otelcol-compression-field.md │ │ │ │ │ ├── otelcol-debug-metrics-block.md │ │ │ │ │ ├── otelcol-filter-attribute-block.md │ │ │ │ │ ├── otelcol-filter-library-block.md │ │ │ │ │ ├── otelcol-filter-log-severity-block.md │ │ │ │ │ ├── otelcol-filter-regexp-block.md │ │ │ │ │ ├── otelcol-filter-resource-block.md │ │ │ │ │ ├── otelcol-grpc-authority.md │ │ │ │ │ ├── otelcol-grpc-balancer-name.md │ │ │ │ │ ├── otelcol-queue-block.md │ │ │ │ │ ├── otelcol-retry-block.md │ │ │ │ │ ├── otelcol-tls-config-block.md │ │ │ │ │ ├── output-block-logs.md │ │ │ │ │ ├── output-block-metrics.md │ │ │ │ │ ├── output-block-traces.md │ │ │ │ │ ├── output-block.md │ │ │ │ │ ├── prom-operator-scrape.md │ │ │ │ │ ├── rule-block-logs.md │ │ │ │ │ ├── rule-block.md │ │ │ │ │ ├── sigv4-block.md │ │ │ │ │ ├── tls-config-block.md │ │ │ │ │ └── write_relabel_config.md │ │ │ └── stability │ │ │ │ ├── beta.md │ │ │ │ └── experimental.md │ │ ├── index.md │ │ └── wal-data-retention.md │ ├── stability.md │ └── static │ │ ├── _index.md │ │ ├── api │ │ └── _index.md │ │ ├── configuration │ │ ├── _index.md │ │ ├── agent-management.md │ │ ├── create-config-file.md │ │ ├── flags.md │ │ ├── integrations │ │ │ ├── _index.md │ │ │ ├── apache-exporter-config.md │ │ │ ├── azure-exporter-config.md │ │ │ ├── blackbox-config.md │ │ │ ├── cadvisor-config.md │ │ │ ├── cloudwatch-exporter-config.md │ │ │ ├── consul-exporter-config.md │ │ │ ├── dnsmasq-exporter-config.md │ │ │ ├── elasticsearch-exporter-config.md │ │ │ ├── gcp-exporter-config.md │ │ │ ├── github-exporter-config.md │ │ │ ├── integrations-next │ │ │ │ ├── _index.md │ │ │ │ ├── app-agent-receiver-config.md │ │ │ │ ├── blackbox-config.md │ │ │ │ ├── eventhandler-config.md │ │ │ │ ├── snmp-config.md │ │ │ │ └── vsphere-config.md │ │ │ ├── kafka-exporter-config.md │ │ │ ├── memcached-exporter-config.md │ │ │ ├── mongodb_exporter-config.md │ │ │ ├── mssql-config.md │ │ │ ├── mysqld-exporter-config.md │ │ │ ├── node-exporter-config.md │ │ │ ├── oracledb-config.md │ │ │ ├── postgres-exporter-config.md │ │ │ ├── process-exporter-config.md │ │ │ ├── redis-exporter-config.md │ │ │ ├── snmp-config.md │ │ │ ├── snowflake-config.md │ │ │ ├── squid-config.md │ │ │ ├── statsd-exporter-config.md │ │ │ └── windows-exporter-config.md │ │ ├── logs-config.md │ │ ├── metrics-config.md │ │ ├── scraping-service.md │ │ ├── server-config.md │ │ └── traces-config.md │ │ ├── operation-guide │ │ └── _index.md │ │ ├── release-notes.md │ │ └── set-up │ │ ├── _index.md │ │ ├── deploy-agent.md │ │ ├── install │ │ ├── _index.md │ │ ├── install-agent-binary.md │ │ ├── install-agent-docker.md │ │ ├── install-agent-kubernetes.md │ │ ├── install-agent-linux.md │ │ ├── install-agent-macos.md │ │ └── install-agent-on-windows.md │ │ ├── quick-starts.md │ │ └── start-agent.md └── variables.mk ├── example └── docker-compose │ ├── README.md │ ├── agent │ └── config │ │ └── agent.yaml │ ├── docker-compose.yaml │ ├── grafana │ ├── config │ │ └── grafana.ini │ ├── dashboards-provisioning │ │ └── dashboards.yaml │ ├── dashboards │ │ ├── agent-logs-pipeline.json │ │ ├── agent-operational.json │ │ ├── agent-remote-write.json │ │ ├── agent-tracing-pipeline.json │ │ ├── agent.json │ │ └── template.jsonnet │ └── datasources │ │ └── datasource.yml │ ├── jsonnetfile.json │ ├── jsonnetfile.lock.json │ └── mimir │ └── config │ └── mimir.yaml ├── go.mod ├── go.sum ├── internal ├── agentseed │ ├── agentseed.go │ └── agentseed_test.go ├── boringcrypto │ ├── disabled.go │ └── enabled.go ├── build │ └── build.go ├── cmd │ ├── agentlint │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal │ │ │ ├── findcomponents │ │ │ │ └── findcomponents.go │ │ │ └── rivertags │ │ │ │ └── rivertags.go │ │ └── main.go │ ├── integration-tests │ │ ├── README.md │ │ ├── common │ │ │ ├── common.go │ │ │ ├── log.go │ │ │ ├── metric.go │ │ │ └── metrics_assert.go │ │ ├── configs │ │ │ ├── kafka │ │ │ │ ├── Dockerfile │ │ │ │ └── main.go │ │ │ ├── mimir │ │ │ │ └── mimir.yaml │ │ │ ├── otel-metrics-gen │ │ │ │ ├── Dockerfile │ │ │ │ └── main.go │ │ │ └── prom-gen │ │ │ │ ├── Dockerfile │ │ │ │ └── main.go │ │ ├── docker-compose.yaml │ │ ├── main.go │ │ ├── tests │ │ │ ├── kafka │ │ │ │ ├── config.river │ │ │ │ └── kafka_metrics_test.go │ │ │ ├── otlp-metrics │ │ │ │ ├── config.river │ │ │ │ ├── otlp_metrics_test.go │ │ │ │ └── otlp_to_prom_metrics_test.go │ │ │ ├── read-log-file │ │ │ │ ├── config.river │ │ │ │ ├── logs.txt │ │ │ │ └── read_log_file_test.go │ │ │ ├── redis │ │ │ │ ├── config.river │ │ │ │ └── redis_metrics_test.go │ │ │ ├── scrape-prom-metrics │ │ │ │ ├── config.river │ │ │ │ └── scrape_prom_metrics_test.go │ │ │ └── unix │ │ │ │ ├── config.river │ │ │ │ └── unix_metrics_test.go │ │ └── utils.go │ └── rivereval │ │ ├── example.river │ │ └── main.go ├── component │ ├── all │ │ ├── all.go │ │ └── all_test.go │ ├── common │ │ ├── config │ │ │ ├── selectors.go │ │ │ ├── types.go │ │ │ └── types_test.go │ │ ├── kubernetes │ │ │ ├── diff.go │ │ │ ├── diff_test.go │ │ │ ├── event.go │ │ │ ├── kubernetes.go │ │ │ ├── kubernetes_test.go │ │ │ ├── rules.go │ │ │ └── rules_test.go │ │ ├── loki │ │ │ ├── client │ │ │ │ ├── batch.go │ │ │ │ ├── batch_test.go │ │ │ │ ├── client.go │ │ │ │ ├── client_test.go │ │ │ │ ├── config.go │ │ │ │ ├── config_test.go │ │ │ │ ├── fake │ │ │ │ │ └── client.go │ │ │ │ ├── internal │ │ │ │ │ ├── marker_encoding.go │ │ │ │ │ ├── marker_encoding_test.go │ │ │ │ │ ├── marker_file_handler.go │ │ │ │ │ ├── marker_file_handler_test.go │ │ │ │ │ ├── marker_handler.go │ │ │ │ │ ├── marker_handler_test.go │ │ │ │ │ └── metrics.go │ │ │ │ ├── logger.go │ │ │ │ ├── logger_test.go │ │ │ │ ├── manager.go │ │ │ │ ├── manager_test.go │ │ │ │ ├── metrics.go │ │ │ │ ├── queue_client.go │ │ │ │ └── queue_client_test.go │ │ │ ├── limit │ │ │ │ └── config.go │ │ │ ├── positions │ │ │ │ ├── positions.go │ │ │ │ ├── positions_test.go │ │ │ │ ├── write_positions_unix.go │ │ │ │ └── write_positions_windows.go │ │ │ ├── types.go │ │ │ ├── utils │ │ │ │ ├── convert.go │ │ │ │ ├── remotewrite_server.go │ │ │ │ └── sync.go │ │ │ └── wal │ │ │ │ ├── config.go │ │ │ │ ├── internal │ │ │ │ └── watcher_state.go │ │ │ │ ├── reader.go │ │ │ │ ├── timer.go │ │ │ │ ├── timer_test.go │ │ │ │ ├── wal.go │ │ │ │ ├── watcher.go │ │ │ │ ├── watcher_metrics.go │ │ │ │ ├── watcher_test.go │ │ │ │ ├── writer.go │ │ │ │ └── writer_test.go │ │ ├── net │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── server.go │ │ │ └── server_test.go │ │ └── relabel │ │ │ ├── relabel.go │ │ │ └── relabel_test.go │ ├── component.go │ ├── component_health.go │ ├── component_health_test.go │ ├── component_provider.go │ ├── discovery │ │ ├── aws │ │ │ ├── ec2.go │ │ │ ├── ec2_test.go │ │ │ └── lightsail.go │ │ ├── azure │ │ │ ├── azure.go │ │ │ └── azure_test.go │ │ ├── consul │ │ │ ├── consul.go │ │ │ └── consul_test.go │ │ ├── consulagent │ │ │ ├── consulagent.go │ │ │ ├── consulagent_test.go │ │ │ ├── promtail_consulagent.go │ │ │ └── promtail_consulagent_test.go │ │ ├── digitalocean │ │ │ ├── digitalocean.go │ │ │ └── digitalocean_test.go │ │ ├── discovery.go │ │ ├── dns │ │ │ ├── dns.go │ │ │ └── dns_test.go │ │ ├── docker │ │ │ ├── docker.go │ │ │ └── docker_test.go │ │ ├── dockerswarm │ │ │ ├── dockerswarm.go │ │ │ └── dockerswarm_test.go │ │ ├── eureka │ │ │ ├── eureka.go │ │ │ └── eureka_test.go │ │ ├── file │ │ │ ├── file.go │ │ │ └── file_test.go │ │ ├── gce │ │ │ ├── gce.go │ │ │ └── gce_test.go │ │ ├── hetzner │ │ │ ├── hetzner.go │ │ │ └── hetzner_test.go │ │ ├── http │ │ │ ├── http.go │ │ │ └── http_test.go │ │ ├── ionos │ │ │ ├── ionos.go │ │ │ └── ionos_test.go │ │ ├── kubelet │ │ │ ├── kubelet.go │ │ │ └── kubelet_test.go │ │ ├── kubernetes │ │ │ ├── kubernetes.go │ │ │ └── kubernetes_test.go │ │ ├── kuma │ │ │ ├── kuma.go │ │ │ └── kuma_test.go │ │ ├── linode │ │ │ ├── linode.go │ │ │ └── linode_test.go │ │ ├── marathon │ │ │ ├── marathon.go │ │ │ └── marathon_test.go │ │ ├── nerve │ │ │ ├── nerve.go │ │ │ └── nerve_test.go │ │ ├── nomad │ │ │ ├── nomad.go │ │ │ └── nomad_test.go │ │ ├── openstack │ │ │ ├── openstack.go │ │ │ └── openstack_test.go │ │ ├── ovhcloud │ │ │ ├── ovhcloud.go │ │ │ └── ovhcloud_test.go │ │ ├── process │ │ │ ├── args.go │ │ │ ├── container.go │ │ │ ├── container_test.go │ │ │ ├── discover.go │ │ │ ├── join.go │ │ │ ├── join_test.go │ │ │ ├── process.go │ │ │ └── process_stub.go │ │ ├── puppetdb │ │ │ ├── puppetdb.go │ │ │ └── puppetdb_test.go │ │ ├── relabel │ │ │ ├── relabel.go │ │ │ └── relabel_test.go │ │ ├── scaleway │ │ │ ├── scaleway.go │ │ │ └── scaleway_test.go │ │ ├── serverset │ │ │ ├── serverset.go │ │ │ └── serverset_test.go │ │ ├── triton │ │ │ ├── triton.go │ │ │ └── triton_test.go │ │ └── uyuni │ │ │ ├── uyuni.go │ │ │ └── uyuni_test.go │ ├── faro │ │ └── receiver │ │ │ ├── arguments.go │ │ │ ├── exporters.go │ │ │ ├── exporters_test.go │ │ │ ├── handler.go │ │ │ ├── handler_test.go │ │ │ ├── internal │ │ │ └── payload │ │ │ │ ├── payload.go │ │ │ │ ├── payload_test.go │ │ │ │ └── utils.go │ │ │ ├── receiver.go │ │ │ ├── receiver_otelcol_test.go │ │ │ ├── receiver_test.go │ │ │ ├── server.go │ │ │ ├── sourcemaps.go │ │ │ ├── sourcemaps_test.go │ │ │ └── testdata │ │ │ ├── foo.js │ │ │ ├── foo.js.map │ │ │ ├── payload.json │ │ │ └── payload_2.json │ ├── local │ │ ├── file │ │ │ ├── file.go │ │ │ └── file_test.go │ │ └── file_match │ │ │ ├── file.go │ │ │ ├── file_test.go │ │ │ └── watch.go │ ├── loki │ │ ├── echo │ │ │ └── echo.go │ │ ├── process │ │ │ ├── metric │ │ │ │ ├── counters.go │ │ │ │ ├── counters_test.go │ │ │ │ ├── gauges.go │ │ │ │ ├── gauges_test.go │ │ │ │ ├── histograms.go │ │ │ │ ├── histograms_test.go │ │ │ │ └── metricvec.go │ │ │ ├── process.go │ │ │ ├── process_test.go │ │ │ └── stages │ │ │ │ ├── decolorize.go │ │ │ │ ├── decolorize_test.go │ │ │ │ ├── drop.go │ │ │ │ ├── drop_test.go │ │ │ │ ├── eventlogmessage.go │ │ │ │ ├── eventlogmessage_test.go │ │ │ │ ├── extensions.go │ │ │ │ ├── extensions_test.go │ │ │ │ ├── geoip.go │ │ │ │ ├── geoip_test.go │ │ │ │ ├── inspector.go │ │ │ │ ├── json.go │ │ │ │ ├── json_test.go │ │ │ │ ├── label_drop.go │ │ │ │ ├── label_drop_test.go │ │ │ │ ├── label_keep.go │ │ │ │ ├── label_keep_test.go │ │ │ │ ├── labels.go │ │ │ │ ├── labels_test.go │ │ │ │ ├── limit.go │ │ │ │ ├── limit_test.go │ │ │ │ ├── logfmt.go │ │ │ │ ├── logfmt_test.go │ │ │ │ ├── luhn.go │ │ │ │ ├── luhn_test.go │ │ │ │ ├── match.go │ │ │ │ ├── match_test.go │ │ │ │ ├── metric.go │ │ │ │ ├── metric_test.go │ │ │ │ ├── multiline.go │ │ │ │ ├── multiline_test.go │ │ │ │ ├── output.go │ │ │ │ ├── output_test.go │ │ │ │ ├── pack.go │ │ │ │ ├── pack_test.go │ │ │ │ ├── pipeline.go │ │ │ │ ├── pipeline_test.go │ │ │ │ ├── regex.go │ │ │ │ ├── regex_test.go │ │ │ │ ├── replace.go │ │ │ │ ├── replace_test.go │ │ │ │ ├── sampling.go │ │ │ │ ├── sampling_test.go │ │ │ │ ├── stage.go │ │ │ │ ├── static_labels.go │ │ │ │ ├── static_labels_test.go │ │ │ │ ├── structured_metadata.go │ │ │ │ ├── structured_metadata_test.go │ │ │ │ ├── template.go │ │ │ │ ├── template_test.go │ │ │ │ ├── tenant.go │ │ │ │ ├── tenant_test.go │ │ │ │ ├── testdata │ │ │ │ ├── geoip_maxmind_asn.mmdb │ │ │ │ ├── geoip_maxmind_city.mmdb │ │ │ │ ├── geoip_maxmind_country.mmdb │ │ │ │ └── geoip_source.json │ │ │ │ ├── timestamp.go │ │ │ │ ├── timestamp_test.go │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ ├── relabel │ │ │ ├── metrics.go │ │ │ ├── relabel.go │ │ │ └── relabel_test.go │ │ ├── rules │ │ │ └── kubernetes │ │ │ │ ├── debug.go │ │ │ │ ├── events.go │ │ │ │ ├── events_test.go │ │ │ │ ├── health.go │ │ │ │ ├── rules.go │ │ │ │ ├── rules_test.go │ │ │ │ └── types.go │ │ ├── source │ │ │ ├── api │ │ │ │ ├── api.go │ │ │ │ ├── api_test.go │ │ │ │ └── internal │ │ │ │ │ └── lokipush │ │ │ │ │ ├── push_api_server.go │ │ │ │ │ └── push_api_server_test.go │ │ │ ├── aws_firehose │ │ │ │ ├── component.go │ │ │ │ ├── component_test.go │ │ │ │ └── internal │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── handler.go │ │ │ │ │ ├── handler_test.go │ │ │ │ │ ├── metrics.go │ │ │ │ │ ├── model.go │ │ │ │ │ └── testdata │ │ │ │ │ ├── cw_logs_control_and_bad_records.json │ │ │ │ │ ├── cw_logs_mixed.json │ │ │ │ │ ├── cw_logs_with_only_control_messages.json │ │ │ │ │ ├── cw_logs_with_only_data_messages.json │ │ │ │ │ ├── direct_put.json │ │ │ │ │ └── direct_put_with_non_json_message.json │ │ │ ├── azure_event_hubs │ │ │ │ ├── azure_event_hubs.go │ │ │ │ ├── azure_event_hubs_test.go │ │ │ │ └── internal │ │ │ │ │ └── parser │ │ │ │ │ ├── parser.go │ │ │ │ │ ├── parser_test.go │ │ │ │ │ └── testdata │ │ │ │ │ ├── custom_message_and_logic_app_logs.json │ │ │ │ │ ├── custom_payload_json.json │ │ │ │ │ ├── custom_payload_json_with_records_array.json │ │ │ │ │ ├── custom_payload_json_with_records_string.json │ │ │ │ │ ├── custom_payload_text.txt │ │ │ │ │ ├── function_app_logs_message.txt │ │ │ │ │ ├── logic_app_logs_message.json │ │ │ │ │ └── message_with_invalid_time.json │ │ │ ├── cloudflare │ │ │ │ ├── cloudflare.go │ │ │ │ └── internal │ │ │ │ │ └── cloudflaretarget │ │ │ │ │ ├── client.go │ │ │ │ │ ├── fields.go │ │ │ │ │ ├── fields_test.go │ │ │ │ │ ├── metrics.go │ │ │ │ │ ├── target.go │ │ │ │ │ ├── target_test.go │ │ │ │ │ └── util_test.go │ │ │ ├── docker │ │ │ │ ├── docker.go │ │ │ │ ├── docker_test.go │ │ │ │ ├── internal │ │ │ │ │ └── dockertarget │ │ │ │ │ │ ├── metrics.go │ │ │ │ │ │ ├── target.go │ │ │ │ │ │ ├── target_test.go │ │ │ │ │ │ └── testdata │ │ │ │ │ │ ├── flog.log │ │ │ │ │ │ └── flog_after_restart.log │ │ │ │ └── runner.go │ │ │ ├── file │ │ │ │ ├── compression_format.go │ │ │ │ ├── decompresser.go │ │ │ │ ├── decompresser_test.go │ │ │ │ ├── file.go │ │ │ │ ├── file_test.go │ │ │ │ ├── legacy_file_test.go │ │ │ │ ├── metrics.go │ │ │ │ ├── reader.go │ │ │ │ ├── tailer.go │ │ │ │ ├── tailer_test.go │ │ │ │ └── testdata │ │ │ │ │ ├── long-access.gz │ │ │ │ │ ├── long-access.tar.gz │ │ │ │ │ ├── onelinelog.log │ │ │ │ │ ├── onelinelog.log.bz2 │ │ │ │ │ ├── onelinelog.log.gz │ │ │ │ │ ├── onelinelog.tar.gz │ │ │ │ │ ├── short-access.log │ │ │ │ │ └── short-access.tar.gz │ │ │ ├── gcplog │ │ │ │ ├── gcplog.go │ │ │ │ ├── gcplog_test.go │ │ │ │ ├── gcptypes │ │ │ │ │ └── gcptypes.go │ │ │ │ └── internal │ │ │ │ │ └── gcplogtarget │ │ │ │ │ ├── formatter.go │ │ │ │ │ ├── formatter_test.go │ │ │ │ │ ├── metrics.go │ │ │ │ │ ├── pull_target.go │ │ │ │ │ ├── pull_target_test.go │ │ │ │ │ ├── push_target.go │ │ │ │ │ ├── push_target_test.go │ │ │ │ │ ├── push_translation.go │ │ │ │ │ ├── push_translation_test.go │ │ │ │ │ └── types.go │ │ │ ├── gelf │ │ │ │ ├── gelf.go │ │ │ │ ├── gelf_test.go │ │ │ │ └── internal │ │ │ │ │ └── target │ │ │ │ │ ├── gelftarget.go │ │ │ │ │ └── metrics.go │ │ │ ├── heroku │ │ │ │ ├── heroku.go │ │ │ │ ├── heroku_test.go │ │ │ │ └── internal │ │ │ │ │ └── herokutarget │ │ │ │ │ ├── herokutarget.go │ │ │ │ │ ├── metrics.go │ │ │ │ │ └── target_test.go │ │ │ ├── internal │ │ │ │ └── kafkatarget │ │ │ │ │ ├── authentication.go │ │ │ │ │ ├── config.go │ │ │ │ │ ├── consumer.go │ │ │ │ │ ├── consumer_test.go │ │ │ │ │ ├── formatter.go │ │ │ │ │ ├── kafkatarget.go │ │ │ │ │ ├── kafkatarget_test.go │ │ │ │ │ ├── oauth_provider.go │ │ │ │ │ ├── parser.go │ │ │ │ │ ├── target_syncer.go │ │ │ │ │ ├── target_syncer_test.go │ │ │ │ │ ├── testdata │ │ │ │ │ ├── example.com-key.pem │ │ │ │ │ ├── example.com.ca.pem │ │ │ │ │ └── example.com.pem │ │ │ │ │ ├── topics.go │ │ │ │ │ └── topics_test.go │ │ │ ├── journal │ │ │ │ ├── internal │ │ │ │ │ └── target │ │ │ │ │ │ ├── journaltarget.go │ │ │ │ │ │ ├── journaltarget_test.go │ │ │ │ │ │ └── metrics.go │ │ │ │ ├── journal.go │ │ │ │ ├── journal_stub.go │ │ │ │ ├── journal_test.go │ │ │ │ └── types.go │ │ │ ├── kafka │ │ │ │ ├── kafka.go │ │ │ │ └── kafka_test.go │ │ │ ├── kubernetes │ │ │ │ ├── kubernetes.go │ │ │ │ ├── kubernetes_test.go │ │ │ │ └── kubetail │ │ │ │ │ ├── container_utils.go │ │ │ │ │ ├── kubetail.go │ │ │ │ │ ├── tail_utils.go │ │ │ │ │ ├── tail_utils_test.go │ │ │ │ │ ├── tailer.go │ │ │ │ │ ├── tailer_test.go │ │ │ │ │ └── target.go │ │ │ ├── kubernetes_events │ │ │ │ ├── event_controller.go │ │ │ │ └── kubernetes_events.go │ │ │ ├── podlogs │ │ │ │ ├── controller.go │ │ │ │ ├── internal │ │ │ │ │ └── apis │ │ │ │ │ │ └── monitoring │ │ │ │ │ │ └── v1alpha2 │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── group.go │ │ │ │ │ │ ├── types.go │ │ │ │ │ │ └── zz_generated.deepcopy.go │ │ │ │ ├── podlogs.go │ │ │ │ ├── podlogs_test.go │ │ │ │ ├── reconciler.go │ │ │ │ └── relabel.go │ │ │ ├── syslog │ │ │ │ ├── internal │ │ │ │ │ └── syslogtarget │ │ │ │ │ │ ├── metrics.go │ │ │ │ │ │ ├── syslogtarget.go │ │ │ │ │ │ ├── syslogtarget_test.go │ │ │ │ │ │ └── transport.go │ │ │ │ ├── syslog.go │ │ │ │ ├── syslog_test.go │ │ │ │ └── types.go │ │ │ └── windowsevent │ │ │ │ ├── arguments.go │ │ │ │ ├── bookmark.go │ │ │ │ ├── component_stub.go │ │ │ │ ├── component_test.go │ │ │ │ ├── component_windows.go │ │ │ │ ├── format.go │ │ │ │ └── target.go │ │ └── write │ │ │ ├── types.go │ │ │ ├── write.go │ │ │ └── write_test.go │ ├── metadata │ │ ├── metadata.go │ │ └── metadata_test.go │ ├── mimir │ │ └── rules │ │ │ └── kubernetes │ │ │ ├── debug.go │ │ │ ├── events.go │ │ │ ├── events_test.go │ │ │ ├── health.go │ │ │ ├── rules.go │ │ │ ├── rules_test.go │ │ │ └── types.go │ ├── module │ │ ├── file │ │ │ └── file.go │ │ ├── git │ │ │ └── git.go │ │ ├── http │ │ │ └── http.go │ │ ├── module.go │ │ └── string │ │ │ └── string.go │ ├── otelcol │ │ ├── auth │ │ │ ├── auth.go │ │ │ ├── auth_test.go │ │ │ ├── basic │ │ │ │ ├── basic.go │ │ │ │ └── basic_test.go │ │ │ ├── bearer │ │ │ │ ├── bearer.go │ │ │ │ └── bearer_test.go │ │ │ ├── headers │ │ │ │ ├── headers.go │ │ │ │ └── headers_test.go │ │ │ ├── oauth2 │ │ │ │ ├── oauth2.go │ │ │ │ └── oauth2_test.go │ │ │ └── sigv4 │ │ │ │ ├── sigv4.go │ │ │ │ └── sigv4_test.go │ │ ├── config_attraction.go │ │ ├── config_attraction_test.go │ │ ├── config_compression.go │ │ ├── config_debug_metrics.go │ │ ├── config_filter.go │ │ ├── config_filter_test.go │ │ ├── config_grpc.go │ │ ├── config_http.go │ │ ├── config_k8s.go │ │ ├── config_queue.go │ │ ├── config_retry.go │ │ ├── config_scrape.go │ │ ├── config_timeout.go │ │ ├── config_tls.go │ │ ├── connector │ │ │ ├── connector.go │ │ │ ├── host_info │ │ │ │ ├── config.go │ │ │ │ ├── config_test.go │ │ │ │ ├── connector.go │ │ │ │ ├── connector_test.go │ │ │ │ ├── factory.go │ │ │ │ ├── factory_test.go │ │ │ │ ├── host_info.go │ │ │ │ ├── host_info_test.go │ │ │ │ ├── host_metrics.go │ │ │ │ └── host_metrics_test.go │ │ │ ├── servicegraph │ │ │ │ ├── servicegraph.go │ │ │ │ └── servicegraph_test.go │ │ │ ├── spanlogs │ │ │ │ ├── consumer.go │ │ │ │ ├── spanlogs.go │ │ │ │ └── spanlogs_test.go │ │ │ └── spanmetrics │ │ │ │ ├── spanmetrics.go │ │ │ │ ├── spanmetrics_test.go │ │ │ │ └── types.go │ │ ├── consumer.go │ │ ├── exporter │ │ │ ├── debug │ │ │ │ ├── debug.go │ │ │ │ └── debug_test.go │ │ │ ├── exporter.go │ │ │ ├── exporter_test.go │ │ │ ├── loadbalancing │ │ │ │ ├── loadbalancing.go │ │ │ │ └── loadbalancing_test.go │ │ │ ├── logging │ │ │ │ └── logging.go │ │ │ ├── loki │ │ │ │ ├── internal │ │ │ │ │ └── convert │ │ │ │ │ │ ├── convert.go │ │ │ │ │ │ ├── convert_test.go │ │ │ │ │ │ └── metrics.go │ │ │ │ └── loki.go │ │ │ ├── otlp │ │ │ │ ├── otlp.go │ │ │ │ └── otlp_test.go │ │ │ ├── otlphttp │ │ │ │ ├── otlphttp.go │ │ │ │ └── otlphttp_test.go │ │ │ └── prometheus │ │ │ │ ├── internal │ │ │ │ └── convert │ │ │ │ │ ├── cache.go │ │ │ │ │ ├── convert.go │ │ │ │ │ ├── convert_test.go │ │ │ │ │ └── histograms.go │ │ │ │ ├── prometheus.go │ │ │ │ └── prometheus_test.go │ │ ├── extension │ │ │ ├── extension.go │ │ │ ├── extension_test.go │ │ │ └── jaeger_remote_sampling │ │ │ │ ├── internal │ │ │ │ ├── jaegerremotesampling │ │ │ │ │ ├── README.md │ │ │ │ │ ├── config.go │ │ │ │ │ ├── config_test.go │ │ │ │ │ ├── extension.go │ │ │ │ │ ├── extension_test.go │ │ │ │ │ ├── factory.go │ │ │ │ │ ├── factory_test.go │ │ │ │ │ ├── internal │ │ │ │ │ │ ├── grpc.go │ │ │ │ │ │ ├── grpc_test.go │ │ │ │ │ │ ├── http.go │ │ │ │ │ │ ├── http_test.go │ │ │ │ │ │ ├── internal_test.go │ │ │ │ │ │ ├── metadata │ │ │ │ │ │ │ └── generated_status.go │ │ │ │ │ │ ├── remote_strategy_cache.go │ │ │ │ │ │ ├── remote_strategy_cache_test.go │ │ │ │ │ │ └── remote_strategy_store.go │ │ │ │ │ └── testdata │ │ │ │ │ │ ├── config.yaml │ │ │ │ │ │ └── strategy.json │ │ │ │ └── strategy_store │ │ │ │ │ ├── README.md │ │ │ │ │ ├── constants.go │ │ │ │ │ ├── strategy.go │ │ │ │ │ ├── strategy_store.go │ │ │ │ │ └── strategy_store_test.go │ │ │ │ ├── jaeger_remote_sampling.go │ │ │ │ └── jaeger_remote_sampling_test.go │ │ ├── internal │ │ │ ├── fakeconsumer │ │ │ │ └── fake.go │ │ │ ├── fanoutconsumer │ │ │ │ ├── logs.go │ │ │ │ ├── metrics.go │ │ │ │ └── traces.go │ │ │ ├── lazycollector │ │ │ │ └── lazycollector.go │ │ │ ├── lazyconsumer │ │ │ │ └── lazyconsumer.go │ │ │ ├── scheduler │ │ │ │ ├── host.go │ │ │ │ ├── scheduler.go │ │ │ │ └── scheduler_test.go │ │ │ └── views │ │ │ │ └── views.go │ │ ├── processor │ │ │ ├── attributes │ │ │ │ ├── attributes.go │ │ │ │ └── attributes_test.go │ │ │ ├── batch │ │ │ │ ├── batch.go │ │ │ │ └── batch_test.go │ │ │ ├── discovery │ │ │ │ ├── discovery.go │ │ │ │ └── discovery_test.go │ │ │ ├── filter │ │ │ │ ├── filter.go │ │ │ │ ├── filter_test.go │ │ │ │ └── types.go │ │ │ ├── k8sattributes │ │ │ │ ├── k8sattributes.go │ │ │ │ ├── k8sattributes_test.go │ │ │ │ └── types.go │ │ │ ├── memorylimiter │ │ │ │ ├── memorylimiter.go │ │ │ │ └── memorylimiter_test.go │ │ │ ├── probabilistic_sampler │ │ │ │ ├── probabilistic_sampler.go │ │ │ │ └── probabilistic_sampler_test.go │ │ │ ├── processor.go │ │ │ ├── processor_test.go │ │ │ ├── processortest │ │ │ │ ├── compare_signals.go │ │ │ │ ├── compare_signals_test.go │ │ │ │ └── processortest.go │ │ │ ├── resourcedetection │ │ │ │ ├── internal │ │ │ │ │ ├── aws │ │ │ │ │ │ ├── ec2 │ │ │ │ │ │ │ └── config.go │ │ │ │ │ │ ├── ecs │ │ │ │ │ │ │ └── config.go │ │ │ │ │ │ ├── eks │ │ │ │ │ │ │ └── config.go │ │ │ │ │ │ ├── elasticbeanstalk │ │ │ │ │ │ │ └── config.go │ │ │ │ │ │ └── lambda │ │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── azure │ │ │ │ │ │ ├── aks │ │ │ │ │ │ │ └── config.go │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── consul │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── docker │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── gcp │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── heroku │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── k8snode │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── openshift │ │ │ │ │ │ └── config.go │ │ │ │ │ ├── resource_attribute_config │ │ │ │ │ │ └── resource_attribute_config.go │ │ │ │ │ └── system │ │ │ │ │ │ └── config.go │ │ │ │ ├── resourcedetection.go │ │ │ │ └── resourcedetection_test.go │ │ │ ├── span │ │ │ │ ├── span.go │ │ │ │ └── span_test.go │ │ │ ├── tail_sampling │ │ │ │ ├── tail_sampling.go │ │ │ │ ├── tail_sampling_test.go │ │ │ │ └── types.go │ │ │ └── transform │ │ │ │ ├── transform.go │ │ │ │ └── transform_test.go │ │ └── receiver │ │ │ ├── jaeger │ │ │ ├── jaeger.go │ │ │ └── jaeger_test.go │ │ │ ├── kafka │ │ │ ├── kafka.go │ │ │ └── kafka_test.go │ │ │ ├── loki │ │ │ ├── loki.go │ │ │ └── loki_test.go │ │ │ ├── opencensus │ │ │ ├── opencensus.go │ │ │ └── opencensus_test.go │ │ │ ├── otlp │ │ │ ├── otlp.go │ │ │ ├── otlp_test.go │ │ │ └── testdata │ │ │ │ └── payload.json │ │ │ ├── prometheus │ │ │ ├── internal │ │ │ │ ├── appendable.go │ │ │ │ ├── doc.go │ │ │ │ ├── logger.go │ │ │ │ ├── logger_test.go │ │ │ │ ├── metadata.go │ │ │ │ ├── metricfamily.go │ │ │ │ ├── metricfamily_test.go │ │ │ │ ├── metrics_adjuster.go │ │ │ │ ├── metrics_adjuster_test.go │ │ │ │ ├── metricsutil_test.go │ │ │ │ ├── prom_to_otlp.go │ │ │ │ ├── prom_to_otlp_test.go │ │ │ │ ├── staleness_end_to_end_test.go │ │ │ │ ├── starttimemetricadjuster.go │ │ │ │ ├── starttimemetricadjuster_test.go │ │ │ │ ├── transaction.go │ │ │ │ ├── transaction_test.go │ │ │ │ ├── util.go │ │ │ │ └── util_test.go │ │ │ ├── prometheus.go │ │ │ └── prometheus_test.go │ │ │ ├── receiver.go │ │ │ ├── receiver_test.go │ │ │ ├── vcenter │ │ │ ├── vcenter.go │ │ │ └── vcenter_test.go │ │ │ └── zipkin │ │ │ ├── zipkin.go │ │ │ └── zipkin_test.go │ ├── prometheus │ │ ├── exporter │ │ │ ├── apache │ │ │ │ └── apache.go │ │ │ ├── azure │ │ │ │ └── azure.go │ │ │ ├── blackbox │ │ │ │ ├── blackbox.go │ │ │ │ └── blackbox_test.go │ │ │ ├── cadvisor │ │ │ │ ├── cadvisor.go │ │ │ │ └── cadvisor_test.go │ │ │ ├── cloudwatch │ │ │ │ ├── cloudwatch.go │ │ │ │ ├── config.go │ │ │ │ └── config_test.go │ │ │ ├── consul │ │ │ │ └── consul.go │ │ │ ├── dnsmasq │ │ │ │ ├── dnsmasq.go │ │ │ │ └── dnsmasq_test.go │ │ │ ├── elasticsearch │ │ │ │ ├── elasticsearch.go │ │ │ │ └── elasticsearch_test.go │ │ │ ├── exporter.go │ │ │ ├── gcp │ │ │ │ ├── gcp.go │ │ │ │ └── gcp_test.go │ │ │ ├── github │ │ │ │ ├── github.go │ │ │ │ └── github_test.go │ │ │ ├── kafka │ │ │ │ ├── kafka.go │ │ │ │ └── kafka_test.go │ │ │ ├── memcached │ │ │ │ ├── memcached.go │ │ │ │ └── memcached_test.go │ │ │ ├── mongodb │ │ │ │ ├── mongodb.go │ │ │ │ └── mongodb_test.go │ │ │ ├── mssql │ │ │ │ ├── mssql.go │ │ │ │ └── mssql_test.go │ │ │ ├── mysql │ │ │ │ ├── mysql.go │ │ │ │ └── mysql_test.go │ │ │ ├── oracledb │ │ │ │ ├── oracledb.go │ │ │ │ └── oracledb_test.go │ │ │ ├── postgres │ │ │ │ ├── postgres.go │ │ │ │ └── postgres_test.go │ │ │ ├── process │ │ │ │ ├── process.go │ │ │ │ └── process_test.go │ │ │ ├── redis │ │ │ │ ├── redis.go │ │ │ │ └── redis_test.go │ │ │ ├── self │ │ │ │ └── self.go │ │ │ ├── snmp │ │ │ │ ├── snmp.go │ │ │ │ └── snmp_test.go │ │ │ ├── snowflake │ │ │ │ ├── snowflake.go │ │ │ │ └── snowflake_test.go │ │ │ ├── squid │ │ │ │ ├── squid.go │ │ │ │ └── squid_test.go │ │ │ ├── statsd │ │ │ │ ├── config.go │ │ │ │ ├── statsd.go │ │ │ │ ├── statsd_test.go │ │ │ │ └── testdata │ │ │ │ │ └── mapTest.yaml │ │ │ ├── unix │ │ │ │ ├── config.go │ │ │ │ └── unix.go │ │ │ ├── vsphere │ │ │ │ ├── vsphere.go │ │ │ │ └── vsphere_test.go │ │ │ └── windows │ │ │ │ ├── config.go │ │ │ │ ├── config_default_windows_test.go │ │ │ │ ├── config_windows.go │ │ │ │ ├── windows.go │ │ │ │ └── windows_test.go │ │ ├── fanout.go │ │ ├── fanout_test.go │ │ ├── interceptor.go │ │ ├── operator │ │ │ ├── common │ │ │ │ ├── component.go │ │ │ │ ├── crdmanager.go │ │ │ │ ├── crdmanager_test.go │ │ │ │ └── interfaces.go │ │ │ ├── configgen │ │ │ │ ├── config_gen.go │ │ │ │ ├── config_gen_podmonitor.go │ │ │ │ ├── config_gen_podmonitor_test.go │ │ │ │ ├── config_gen_probe.go │ │ │ │ ├── config_gen_probe_test.go │ │ │ │ ├── config_gen_servicemonitor.go │ │ │ │ ├── config_gen_servicemonitor_test.go │ │ │ │ ├── config_gen_test.go │ │ │ │ └── secrets.go │ │ │ ├── podmonitors │ │ │ │ └── operator.go │ │ │ ├── probes │ │ │ │ └── probes.go │ │ │ ├── servicemonitors │ │ │ │ └── servicemonitors.go │ │ │ ├── types.go │ │ │ └── types_test.go │ │ ├── receive_http │ │ │ ├── receive_http.go │ │ │ └── receive_http_test.go │ │ ├── relabel │ │ │ ├── relabel.go │ │ │ └── relabel_test.go │ │ ├── remotewrite │ │ │ ├── cli.go │ │ │ ├── remote_write.go │ │ │ ├── remote_write_test.go │ │ │ ├── types.go │ │ │ └── types_test.go │ │ └── scrape │ │ │ ├── scrape.go │ │ │ └── scrape_test.go │ ├── pyroscope │ │ ├── appender.go │ │ ├── appender_test.go │ │ ├── ebpf │ │ │ ├── args.go │ │ │ ├── ebpf_linux.go │ │ │ ├── ebpf_linux_test.go │ │ │ ├── ebpf_placeholder.go │ │ │ └── metrics.go │ │ ├── java │ │ │ ├── args.go │ │ │ ├── asprof │ │ │ │ ├── asprof.go │ │ │ │ ├── asprof_linux_amd64.go │ │ │ │ ├── asprof_linux_arm64.go │ │ │ │ ├── asprof_test.go │ │ │ │ ├── async-profiler-3.0-linux-arm64.tar.gz │ │ │ │ ├── async-profiler-3.0-linux-x64.tar.gz │ │ │ │ └── extract.go │ │ │ ├── java.go │ │ │ ├── java_stub.go │ │ │ ├── loop.go │ │ │ └── target.go │ │ ├── scrape │ │ │ ├── delta_profiles.go │ │ │ ├── delta_profiles_test.go │ │ │ ├── internal │ │ │ │ ├── fastdelta │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── delta_map.go │ │ │ │ │ ├── fd.go │ │ │ │ │ ├── fd_test.go │ │ │ │ │ ├── fuzz_test.go │ │ │ │ │ ├── hasher.go │ │ │ │ │ ├── location_index.go │ │ │ │ │ ├── location_index_test.go │ │ │ │ │ ├── set.go │ │ │ │ │ ├── string_table.go │ │ │ │ │ └── testdata │ │ │ │ │ │ ├── big-heap.pprof │ │ │ │ │ │ ├── block.after.pprof │ │ │ │ │ │ ├── block.before.pprof │ │ │ │ │ │ ├── fuzz │ │ │ │ │ │ └── FuzzDelta │ │ │ │ │ │ │ ├── 0f7209b356e13da8388f52dba89dfc4669e45654f23e8446fd5292fa1bb62cf3 │ │ │ │ │ │ │ ├── 6281ce98ad6bb944a23bb21f7597f91ae767be28cf9ebfaaa40e3d1454c12be3 │ │ │ │ │ │ │ ├── 74a0704b407ac210d9de0d409cba6bd17597ba4e67e73fcf7bdffa31438ac64f │ │ │ │ │ │ │ ├── 76b05762f4f652d9c3b8aeaf7c0301e0be9045945811b270c33d4f0a2760eea2 │ │ │ │ │ │ │ ├── aafd8cbacf61de60d2748f9d49fb622c32f7f885b5a651355a7350b2fbd4bad8 │ │ │ │ │ │ │ ├── d4fd55d49c674b8963a355107bfd2fb13eb81289831066a0b9f16190c2592c8a │ │ │ │ │ │ │ ├── eec2ef2090730346d172334a24dee416e17c1511472fb808f3f9b4d68a46e3e5 │ │ │ │ │ │ │ └── f06e6fad1d62671c4b62ece89e9d85da6bd270176ce44ec809c52607cdc58680 │ │ │ │ │ │ ├── heap.after.pprof │ │ │ │ │ │ ├── heap.before.pprof │ │ │ │ │ │ ├── heap.pprof │ │ │ │ │ │ ├── stress-failure.2.after.pprof │ │ │ │ │ │ ├── stress-failure.2.before.pprof │ │ │ │ │ │ ├── stress-failure.3.after.pprof │ │ │ │ │ │ ├── stress-failure.3.before.pprof │ │ │ │ │ │ ├── stress-failure.after.pprof │ │ │ │ │ │ └── stress-failure.before.pprof │ │ │ │ └── pproflite │ │ │ │ │ ├── decoder.go │ │ │ │ │ ├── encoder.go │ │ │ │ │ ├── pproflite.go │ │ │ │ │ ├── pproflite_test.go │ │ │ │ │ └── testdata │ │ │ │ │ └── heap.pprof │ │ │ ├── manager.go │ │ │ ├── manager_test.go │ │ │ ├── scrape.go │ │ │ ├── scrape_loop.go │ │ │ ├── scrape_loop_test.go │ │ │ ├── scrape_test.go │ │ │ ├── target.go │ │ │ └── target_test.go │ │ └── write │ │ │ ├── metrics.go │ │ │ ├── write.go │ │ │ └── write_test.go │ ├── registry.go │ ├── registry_test.go │ └── remote │ │ ├── http │ │ ├── http.go │ │ └── http_test.go │ │ ├── kubernetes │ │ ├── configmap │ │ │ └── configmap.go │ │ ├── kubernetes.go │ │ ├── kubernetes_test.go │ │ └── secret │ │ │ └── secret.go │ │ ├── s3 │ │ ├── s3.go │ │ ├── s3_test.go │ │ ├── types.go │ │ └── watcher.go │ │ └── vault │ │ ├── auth.go │ │ ├── client.go │ │ ├── metrics.go │ │ ├── refresher.go │ │ ├── ticker.go │ │ ├── vault.go │ │ └── vault_test.go ├── converter │ ├── converter.go │ ├── diag │ │ ├── diagnostic.go │ │ ├── diagnostics.go │ │ ├── report.go │ │ ├── report_test.go │ │ └── severity.go │ └── internal │ │ ├── common │ │ ├── convert_appendable.go │ │ ├── convert_logs_receiver.go │ │ ├── convert_targets.go │ │ ├── convert_targets_test.go │ │ ├── custom_tokenizer.go │ │ ├── http_client_config.go │ │ ├── river_utils.go │ │ ├── river_utils_test.go │ │ ├── validate.go │ │ ├── validate_test.go │ │ └── weaveworks_server.go │ │ ├── otelcolconvert │ │ ├── converter.go │ │ ├── converter_attributesprocessor.go │ │ ├── converter_basicauthextension.go │ │ ├── converter_batchprocessor.go │ │ ├── converter_bearertokenauthextension.go │ │ ├── converter_filterprocessor.go │ │ ├── converter_headerssetterextension.go │ │ ├── converter_helpers.go │ │ ├── converter_jaegerreceiver.go │ │ ├── converter_jaegerremotesamplingextension.go │ │ ├── converter_k8sattributesprocessor.go │ │ ├── converter_kafkareceiver.go │ │ ├── converter_loadbalancingexporter.go │ │ ├── converter_loggingexporter.go │ │ ├── converter_memorylimiterprocessor.go │ │ ├── converter_oauth2clientauthextension.go │ │ ├── converter_opencensusreceiver.go │ │ ├── converter_otlpexporter.go │ │ ├── converter_otlphttpexporter.go │ │ ├── converter_otlpreceiver.go │ │ ├── converter_probabilisticsamplerprocessor.go │ │ ├── converter_servicegraphconnector.go │ │ ├── converter_sigv4authextension.go │ │ ├── converter_spanmetricsconnector.go │ │ ├── converter_spanprocessor.go │ │ ├── converter_tailsamplingprocessor.go │ │ ├── converter_transformprocessor.go │ │ ├── converter_vcenterreceiver.go │ │ ├── converter_zipkinreceiver.go │ │ ├── otelcolconvert.go │ │ ├── otelcolconvert_test.go │ │ ├── pipeline_group.go │ │ ├── testdata │ │ │ ├── attributes.river │ │ │ ├── attributes.yaml │ │ │ ├── basicauth.river │ │ │ ├── basicauth.yaml │ │ │ ├── batch.river │ │ │ ├── batch.yaml │ │ │ ├── bearertoken.river │ │ │ ├── bearertoken.yaml │ │ │ ├── filter.river │ │ │ ├── filter.yaml │ │ │ ├── headerssetter.river │ │ │ ├── headerssetter.yaml │ │ │ ├── inconsistent_processor.river │ │ │ ├── inconsistent_processor.yaml │ │ │ ├── jaeger.river │ │ │ ├── jaeger.yaml │ │ │ ├── jaegerremotesampling.river │ │ │ ├── jaegerremotesampling.yaml │ │ │ ├── k8sattributes.river │ │ │ ├── k8sattributes.yaml │ │ │ ├── kafka.river │ │ │ ├── kafka.yaml │ │ │ ├── loadbalancing.river │ │ │ ├── loadbalancing.yaml │ │ │ ├── logging.diags │ │ │ ├── logging.river │ │ │ ├── logging.yaml │ │ │ ├── memorylimiter.river │ │ │ ├── memorylimiter.yaml │ │ │ ├── oauth2.river │ │ │ ├── oauth2.yaml │ │ │ ├── opencensus.river │ │ │ ├── opencensus.yaml │ │ │ ├── otelcol_errors │ │ │ │ ├── corrupt_config.diags │ │ │ │ ├── corrupt_config.yaml │ │ │ │ ├── duplicate_receivers.diags │ │ │ │ ├── duplicate_receivers.yaml │ │ │ │ ├── invalid_config.diags │ │ │ │ └── invalid_config.yaml │ │ │ ├── otelcol_without_validation │ │ │ │ ├── sigv4auth.river │ │ │ │ └── sigv4auth.yaml │ │ │ ├── otlp.river │ │ │ ├── otlp.yaml │ │ │ ├── otlphttp.river │ │ │ ├── otlphttp.yaml │ │ │ ├── probabilistic_sampler.river │ │ │ ├── probabilistic_sampler.yaml │ │ │ ├── servicegraph.river │ │ │ ├── servicegraph.yaml │ │ │ ├── span.river │ │ │ ├── span.yaml │ │ │ ├── span_full.river │ │ │ ├── span_full.yaml │ │ │ ├── spanmetrics.river │ │ │ ├── spanmetrics.yaml │ │ │ ├── spanmetrics_full.river │ │ │ ├── spanmetrics_full.yaml │ │ │ ├── tail_sampling.river │ │ │ ├── tail_sampling.yaml │ │ │ ├── transform.river │ │ │ ├── transform.yaml │ │ │ ├── vcenterreceiver.river │ │ │ ├── vcenterreceiver.yaml │ │ │ ├── zipkin.river │ │ │ └── zipkin.yaml │ │ └── utils.go │ │ ├── prometheusconvert │ │ ├── build │ │ │ └── prometheus_blocks.go │ │ ├── component │ │ │ ├── azure.go │ │ │ ├── consul.go │ │ │ ├── digitalocean.go │ │ │ ├── dns.go │ │ │ ├── docker.go │ │ │ ├── dockerswarm.go │ │ │ ├── ec2.go │ │ │ ├── file.go │ │ │ ├── gce.go │ │ │ ├── http.go │ │ │ ├── ionos.go │ │ │ ├── kubernetes.go │ │ │ ├── kuma.go │ │ │ ├── lightsail.go │ │ │ ├── linode.go │ │ │ ├── marathon.go │ │ │ ├── nerve.go │ │ │ ├── openstack.go │ │ │ ├── ovhcloud.go │ │ │ ├── relabel.go │ │ │ ├── remote_write.go │ │ │ ├── scaleway.go │ │ │ ├── scrape.go │ │ │ ├── serverset.go │ │ │ ├── service_discovery.go │ │ │ └── triton.go │ │ ├── prometheusconvert.go │ │ ├── prometheusconvert_test.go │ │ ├── testdata │ │ │ ├── azure.river │ │ │ ├── azure.yaml │ │ │ ├── bad_config.diags │ │ │ ├── bad_config.yaml │ │ │ ├── broken_yaml.diags │ │ │ ├── broken_yaml.yaml │ │ │ ├── consul.river │ │ │ ├── consul.yaml │ │ │ ├── digitalocean.diags │ │ │ ├── digitalocean.river │ │ │ ├── digitalocean.yaml │ │ │ ├── discovery.river │ │ │ ├── discovery.yaml │ │ │ ├── discovery_relabel.river │ │ │ ├── discovery_relabel.yaml │ │ │ ├── dns.river │ │ │ ├── dns.yaml │ │ │ ├── docker.river │ │ │ ├── docker.yaml │ │ │ ├── dockerswarm.river │ │ │ ├── dockerswarm.yaml │ │ │ ├── ec2.river │ │ │ ├── ec2.yaml │ │ │ ├── empty.river │ │ │ ├── empty.yaml │ │ │ ├── file.river │ │ │ ├── file.yaml │ │ │ ├── gce.river │ │ │ ├── gce.yaml │ │ │ ├── http.river │ │ │ ├── http.yaml │ │ │ ├── ionos.river │ │ │ ├── ionos.yaml │ │ │ ├── kubernetes.river │ │ │ ├── kubernetes.yaml │ │ │ ├── kuma.river │ │ │ ├── kuma.yaml │ │ │ ├── lightsail.river │ │ │ ├── lightsail.yaml │ │ │ ├── linode.river │ │ │ ├── linode.yaml │ │ │ ├── marathon.river │ │ │ ├── marathon.yaml │ │ │ ├── metric_relabel.river │ │ │ ├── metric_relabel.yaml │ │ │ ├── nerve.river │ │ │ ├── nerve.yaml │ │ │ ├── openstack.river │ │ │ ├── openstack.yaml │ │ │ ├── ovhcloud.river │ │ │ ├── ovhcloud.yaml │ │ │ ├── scaleway.river │ │ │ ├── scaleway.yaml │ │ │ ├── scrape.diags │ │ │ ├── scrape.river │ │ │ ├── scrape.yaml │ │ │ ├── serverset.river │ │ │ ├── serverset.yaml │ │ │ ├── triton.river │ │ │ ├── triton.yaml │ │ │ ├── unsupported.diags │ │ │ ├── unsupported.river │ │ │ └── unsupported.yaml │ │ └── validate.go │ │ ├── promtailconvert │ │ ├── internal │ │ │ └── build │ │ │ │ ├── azure_event_hub.go │ │ │ │ ├── cloudflare.go │ │ │ │ ├── consul_agent.go │ │ │ │ ├── docker_sd.go │ │ │ │ ├── gcplog.go │ │ │ │ ├── gelf.go │ │ │ │ ├── global_context.go │ │ │ │ ├── herokudrain.go │ │ │ │ ├── journal.go │ │ │ │ ├── kafka.go │ │ │ │ ├── loki_write.go │ │ │ │ ├── push_api.go │ │ │ │ ├── scrape_builder.go │ │ │ │ ├── service_discovery.go │ │ │ │ ├── stages.go │ │ │ │ ├── syslog.go │ │ │ │ └── windows_events.go │ │ ├── promtailconvert.go │ │ ├── promtailconvert_test.go │ │ ├── promtailconvert_windows_test.go │ │ ├── testdata │ │ │ ├── azure.river │ │ │ ├── azure.yaml │ │ │ ├── azure_event_hubs.river │ │ │ ├── azure_event_hubs.yaml │ │ │ ├── bad_config.diags │ │ │ ├── bad_config.yaml │ │ │ ├── cloudflare_relabel.river │ │ │ ├── cloudflare_relabel.yaml │ │ │ ├── consul.river │ │ │ ├── consul.yaml │ │ │ ├── consulagent.diags │ │ │ ├── consulagent.river │ │ │ ├── consulagent.yaml │ │ │ ├── digitalocean.river │ │ │ ├── digitalocean.yaml │ │ │ ├── docker.river │ │ │ ├── docker.yaml │ │ │ ├── docker_relabel.river │ │ │ ├── docker_relabel.yaml │ │ │ ├── dockerswarm.river │ │ │ ├── dockerswarm.yaml │ │ │ ├── ec2.river │ │ │ ├── ec2.yaml │ │ │ ├── file.river │ │ │ ├── file.yaml │ │ │ ├── gce.river │ │ │ ├── gce.yaml │ │ │ ├── gcplog.river │ │ │ ├── gcplog.yaml │ │ │ ├── gelf.river │ │ │ ├── gelf.yaml │ │ │ ├── globalpositions.river │ │ │ ├── globalpositions.yaml │ │ │ ├── heroku.river │ │ │ ├── heroku.yaml │ │ │ ├── journal.river │ │ │ ├── journal.yaml │ │ │ ├── journal_relabel.river │ │ │ ├── journal_relabel.yaml │ │ │ ├── kafka.river │ │ │ ├── kafka.yaml │ │ │ ├── kubernetes.river │ │ │ ├── kubernetes.yaml │ │ │ ├── loki_write.river │ │ │ ├── loki_write.yaml │ │ │ ├── marathon.river │ │ │ ├── marathon.yaml │ │ │ ├── mixed_pipeline.river │ │ │ ├── mixed_pipeline.yaml │ │ │ ├── nerve.river │ │ │ ├── nerve.yaml │ │ │ ├── openstack.river │ │ │ ├── openstack.yaml │ │ │ ├── pipeline_stages_cri_empty.river │ │ │ ├── pipeline_stages_cri_empty.yaml │ │ │ ├── pipeline_stages_drop.diags │ │ │ ├── pipeline_stages_drop.river │ │ │ ├── pipeline_stages_drop.yaml │ │ │ ├── pipeline_stages_match_nested.river │ │ │ ├── pipeline_stages_match_nested.yaml │ │ │ ├── pipeline_stages_part1.river │ │ │ ├── pipeline_stages_part1.yaml │ │ │ ├── pipeline_stages_part2.river │ │ │ ├── pipeline_stages_part2.yaml │ │ │ ├── pipeline_stages_structured_metadata.river │ │ │ ├── pipeline_stages_structured_metadata.yaml │ │ │ ├── push_api.river │ │ │ ├── push_api.yaml │ │ │ ├── push_api_unsupported.diags │ │ │ ├── push_api_unsupported.yaml │ │ │ ├── remote_write_basic_auth.river │ │ │ ├── remote_write_basic_auth.yaml │ │ │ ├── remote_write_basic_auth2.river │ │ │ ├── remote_write_basic_auth2.yaml │ │ │ ├── remote_write_bearer_file.river │ │ │ ├── remote_write_bearer_file.yaml │ │ │ ├── remote_write_bearer_token.river │ │ │ ├── remote_write_bearer_token.yaml │ │ │ ├── remote_write_oauth.river │ │ │ ├── remote_write_oauth.yaml │ │ │ ├── remote_write_oauth2.river │ │ │ ├── remote_write_oauth2.yaml │ │ │ ├── sd_pipeline_example.river │ │ │ ├── sd_pipeline_example.yaml │ │ │ ├── serverset.river │ │ │ ├── serverset.yaml │ │ │ ├── source_pipeline_example.river │ │ │ ├── source_pipeline_example.yaml │ │ │ ├── static_pipeline_example.river │ │ │ ├── static_pipeline_example.yaml │ │ │ ├── syslog.river │ │ │ ├── syslog.yaml │ │ │ ├── triton.river │ │ │ ├── triton.yaml │ │ │ ├── unsupported.diags │ │ │ └── unsupported.yaml │ │ ├── testdata_windows │ │ │ ├── windowsevents.river │ │ │ ├── windowsevents.yaml │ │ │ ├── windowsevents_relabel.river │ │ │ └── windowsevents_relabel.yaml │ │ └── validate.go │ │ ├── staticconvert │ │ ├── internal │ │ │ └── build │ │ │ │ ├── apache_exporter.go │ │ │ │ ├── app_agent_receiver.go │ │ │ │ ├── azure_exporter.go │ │ │ │ ├── blackbox_exporter.go │ │ │ │ ├── builder.go │ │ │ │ ├── builder_integrations.go │ │ │ │ ├── builder_logging.go │ │ │ │ ├── builder_server.go │ │ │ │ ├── builder_traces.go │ │ │ │ ├── cadvisor_exporter.go │ │ │ │ ├── cloudwatch_exporter.go │ │ │ │ ├── consul_exporter.go │ │ │ │ ├── converter_discoveryprocessor.go │ │ │ │ ├── converter_remotewriteexporter.go │ │ │ │ ├── dnsmasq_exporter.go │ │ │ │ ├── elasticsearch_exporter.go │ │ │ │ ├── eventhandler.go │ │ │ │ ├── gcp_exporter.go │ │ │ │ ├── github_exporter.go │ │ │ │ ├── global_context.go │ │ │ │ ├── kafka_exporter.go │ │ │ │ ├── memcached_exporter.go │ │ │ │ ├── mongodb_exporter.go │ │ │ │ ├── mssql_exporter.go │ │ │ │ ├── mysqld_exporter.go │ │ │ │ ├── node_exporter.go │ │ │ │ ├── oracledb_exporter.go │ │ │ │ ├── postgres_exporter.go │ │ │ │ ├── process_exporter.go │ │ │ │ ├── redis_exporter.go │ │ │ │ ├── self_exporter.go │ │ │ │ ├── snmp_exporter.go │ │ │ │ ├── snowflake_exporter.go │ │ │ │ ├── squid_exporter.go │ │ │ │ ├── statsd_exporter.go │ │ │ │ ├── vmware_exporter.go │ │ │ │ └── windows_exporter.go │ │ ├── staticconvert.go │ │ ├── staticconvert_test.go │ │ ├── staticconvert_windows_test.go │ │ ├── testdata-v2 │ │ │ ├── integrations_v2.diags │ │ │ ├── integrations_v2.river │ │ │ ├── integrations_v2.yaml │ │ │ ├── missing_metrics_config.diags │ │ │ ├── missing_metrics_config.yaml │ │ │ ├── unsupported.diags │ │ │ ├── unsupported.river │ │ │ └── unsupported.yaml │ │ ├── testdata-v2_windows │ │ │ ├── integrations_v2.diags │ │ │ ├── integrations_v2.river │ │ │ └── integrations_v2.yaml │ │ ├── testdata │ │ │ ├── dup_labels.diags │ │ │ ├── dup_labels.yaml │ │ │ ├── example-cert.pem │ │ │ ├── example-key.pem │ │ │ ├── integrations.diags │ │ │ ├── integrations.river │ │ │ ├── integrations.yaml │ │ │ ├── integrations_no_rw.diags │ │ │ ├── integrations_no_rw.yaml │ │ │ ├── prom_missing_name.diags │ │ │ ├── prom_missing_name.yaml │ │ │ ├── prom_remote_write.diags │ │ │ ├── prom_remote_write.river │ │ │ ├── prom_remote_write.yaml │ │ │ ├── prom_scrape.diags │ │ │ ├── prom_scrape.river │ │ │ ├── prom_scrape.yaml │ │ │ ├── promtail_scrape.diags │ │ │ ├── promtail_scrape.river │ │ │ ├── promtail_scrape.yaml │ │ │ ├── sanitize.diags │ │ │ ├── sanitize.river │ │ │ ├── sanitize.yaml │ │ │ ├── traces.diags │ │ │ ├── traces.river │ │ │ ├── traces.yaml │ │ │ ├── traces_multi.diags │ │ │ ├── traces_multi.river │ │ │ ├── traces_multi.yaml │ │ │ ├── unsupported.diags │ │ │ ├── unsupported.river │ │ │ └── unsupported.yaml │ │ ├── testdata_linux │ │ │ ├── promtail_prom.diags │ │ │ ├── promtail_prom.river │ │ │ └── promtail_prom.yaml │ │ ├── testdata_windows │ │ │ ├── integrations.diags │ │ │ ├── integrations.river │ │ │ ├── integrations.yaml │ │ │ ├── promtail_prom.diags │ │ │ ├── promtail_prom.river │ │ │ └── promtail_prom.yaml │ │ └── validate.go │ │ └── test_common │ │ └── testing.go ├── featuregate │ ├── featuregate.go │ └── featuregate_test.go ├── filedetector │ └── detector.go ├── flow │ ├── componenttest │ │ ├── componenttest.go │ │ ├── context.go │ │ └── testfailmodule.go │ ├── declare_test.go │ ├── flow.go │ ├── flow_components.go │ ├── flow_services.go │ ├── flow_services_test.go │ ├── flow_test.go │ ├── flow_updates_test.go │ ├── import_git_test.go │ ├── import_test.go │ ├── internal │ │ ├── controller │ │ │ ├── block_node.go │ │ │ ├── component_node.go │ │ │ ├── component_node_manager.go │ │ │ ├── component_references.go │ │ │ ├── component_registry.go │ │ │ ├── custom_component_registry.go │ │ │ ├── loader.go │ │ │ ├── loader_test.go │ │ │ ├── metrics.go │ │ │ ├── module.go │ │ │ ├── node_builtin_component.go │ │ │ ├── node_builtin_component_test.go │ │ │ ├── node_config.go │ │ │ ├── node_config_argument.go │ │ │ ├── node_config_export.go │ │ │ ├── node_config_import.go │ │ │ ├── node_config_logging.go │ │ │ ├── node_config_tracing.go │ │ │ ├── node_custom_component.go │ │ │ ├── node_declare.go │ │ │ ├── node_service.go │ │ │ ├── queue.go │ │ │ ├── queue_test.go │ │ │ ├── scheduler.go │ │ │ ├── scheduler_test.go │ │ │ ├── service_map.go │ │ │ ├── value_cache.go │ │ │ └── value_cache_test.go │ │ ├── dag │ │ │ ├── dag.go │ │ │ ├── ops.go │ │ │ ├── ops_test.go │ │ │ ├── tarjan.go │ │ │ ├── tarjan_test.go │ │ │ └── walk.go │ │ ├── importsource │ │ │ ├── import_file.go │ │ │ ├── import_git.go │ │ │ ├── import_http.go │ │ │ ├── import_source.go │ │ │ └── import_string.go │ │ ├── testcomponents │ │ │ ├── count.go │ │ │ ├── doc.go │ │ │ ├── experimental.go │ │ │ ├── fake.go │ │ │ ├── passthrough.go │ │ │ ├── sumation.go │ │ │ └── tick.go │ │ ├── testservices │ │ │ ├── doc.go │ │ │ └── fake.go │ │ └── worker │ │ │ ├── worker_pool.go │ │ │ └── worker_pool_test.go │ ├── logging │ │ ├── handler.go │ │ ├── handler_test.go │ │ ├── level │ │ │ └── level.go │ │ ├── logger.go │ │ ├── logger_test.go │ │ └── options.go │ ├── module.go │ ├── module_eval_test.go │ ├── module_fail_test.go │ ├── module_registry.go │ ├── module_test.go │ ├── source.go │ ├── source_test.go │ ├── testdata │ │ ├── import_error │ │ │ ├── import_error_1.txtar │ │ │ ├── import_error_2.txtar │ │ │ ├── import_error_3.txtar │ │ │ └── import_error_4.txtar │ │ ├── import_file │ │ │ ├── import_file_1.txtar │ │ │ ├── import_file_10.txtar │ │ │ ├── import_file_11.txtar │ │ │ ├── import_file_12.txtar │ │ │ ├── import_file_13.txtar │ │ │ ├── import_file_14.txtar │ │ │ ├── import_file_15.txtar │ │ │ ├── import_file_16.txtar │ │ │ ├── import_file_17.txtar │ │ │ ├── import_file_2.txtar │ │ │ ├── import_file_3.txtar │ │ │ ├── import_file_4.txtar │ │ │ ├── import_file_5.txtar │ │ │ ├── import_file_6.txtar │ │ │ ├── import_file_7.txtar │ │ │ ├── import_file_8.txtar │ │ │ └── import_file_9.txtar │ │ ├── import_file_folder │ │ │ ├── import_file_folder_1.txtar │ │ │ ├── import_file_folder_2.txtar │ │ │ ├── import_file_folder_3.txtar │ │ │ ├── import_file_folder_4.txtar │ │ │ └── import_file_folder_5.txtar │ │ ├── import_git │ │ │ ├── import_git_1.txtar │ │ │ └── import_git_2.txtar │ │ ├── import_http │ │ │ └── import_http_1.txtar │ │ └── import_string │ │ │ └── import_string_1.txtar │ └── tracing │ │ ├── internal │ │ └── jaegerremote │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── constants.go │ │ │ ├── doc.go │ │ │ ├── sampler.go │ │ │ ├── sampler_remote.go │ │ │ ├── sampler_remote_options.go │ │ │ └── utils │ │ │ ├── http_json.go │ │ │ └── rate_limiter.go │ │ ├── lazy_sampler.go │ │ ├── otelcol_client.go │ │ ├── tracing.go │ │ └── wrap_tracer.go ├── flowmode │ ├── cluster_builder.go │ ├── cluster_builder_test.go │ ├── cmd_convert.go │ ├── cmd_convert_test.go │ ├── cmd_fmt.go │ ├── cmd_run.go │ ├── cmd_tools.go │ ├── flowmode.go │ └── resources_collector.go ├── loki │ └── client │ │ ├── client.go │ │ ├── client_test.go │ │ ├── internal │ │ ├── client.go │ │ └── client_test.go │ │ ├── rules.go │ │ └── rules_test.go ├── mimir │ └── client │ │ ├── client.go │ │ ├── client_test.go │ │ ├── internal │ │ ├── client.go │ │ └── client_test.go │ │ ├── rules.go │ │ └── rules_test.go ├── runner │ ├── hash_map.go │ ├── hash_map_test.go │ ├── runner.go │ └── runner_test.go ├── service │ ├── cluster │ │ ├── cluster.go │ │ ├── cluster_test.go │ │ └── mock.go │ ├── http │ │ ├── handler.go │ │ ├── handler_windows.go │ │ ├── http.go │ │ ├── http_test.go │ │ ├── routes.go │ │ ├── split_path.go │ │ ├── split_path_test.go │ │ ├── testdata │ │ │ ├── config.conf │ │ │ ├── test-cert.crt │ │ │ └── test-key.key │ │ ├── tls.go │ │ └── tls_test.go │ ├── labelstore │ │ ├── data.go │ │ ├── service.go │ │ └── service_test.go │ ├── otel │ │ └── otel.go │ ├── remotecfg │ │ ├── noop.go │ │ ├── remotecfg.go │ │ └── remotecfg_test.go │ ├── service.go │ └── ui │ │ └── ui.go ├── slogadapter │ ├── gokit.go │ └── gokit_test.go ├── tools │ ├── docs_generator │ │ ├── compatible_components_page.go │ │ ├── docs_generator.go │ │ ├── docs_updated_test.go │ │ └── links_to_types.go │ └── packaging_test │ │ ├── agent_linux_packages_test.go │ │ ├── environment_test.go │ │ ├── flow_linux_packages_test.go │ │ └── testdata │ │ ├── centos-systemd.Dockerfile │ │ └── debian-systemd.Dockerfile ├── usagestats │ ├── reporter.go │ ├── reporter_test.go │ └── stats.go ├── useragent │ ├── useragent.go │ └── useragent_test.go ├── util │ ├── compare_yaml.go │ ├── compare_yaml_test.go │ ├── defaults.go │ ├── eventually.go │ ├── eventually_test.go │ ├── k8s │ │ ├── k8s.go │ │ ├── k8s_test.go │ │ ├── objects.go │ │ └── resources.go │ ├── log │ │ └── log.go │ ├── metrics.go │ ├── otel_feature_gate.go │ ├── otel_feature_gate_test.go │ ├── strings.go │ ├── structwalk │ │ ├── structwalk.go │ │ └── structwalk_test.go │ ├── subset │ │ ├── subset.go │ │ └── subset_test.go │ ├── syncbuffer.go │ ├── test_logger.go │ ├── testappender │ │ ├── compare.go │ │ ├── internal │ │ │ └── dtobuilder │ │ │ │ ├── dtobuilder.go │ │ │ │ └── sort.go │ │ ├── testappender.go │ │ └── testappender_test.go │ ├── trigger.go │ ├── trigger_test.go │ ├── unchecked_collector.go │ ├── unregisterer.go │ ├── unregisterer_test.go │ ├── untab.go │ ├── wildcard │ │ ├── match.go │ │ └── match_test.go │ ├── yaml.go │ ├── yaml_test.go │ └── zapadapter │ │ ├── zapadapter.go │ │ └── zapadapter_test.go ├── vcs │ ├── auth.go │ ├── errors.go │ ├── git.go │ └── git_test.go └── web │ ├── api │ └── api.go │ └── ui │ ├── .env │ ├── .env.production │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── assets_builtin.go │ ├── assets_nobuiltin.go │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── manifest.json │ └── robots.txt │ ├── src │ ├── App.module.css │ ├── App.tsx │ ├── Router.tsx │ ├── contexts │ │ └── PathPrefixContext.tsx │ ├── features │ │ ├── clustering │ │ │ ├── PeerList.module.css │ │ │ ├── PeerList.tsx │ │ │ ├── Table.module.css │ │ │ ├── Table.tsx │ │ │ └── types.ts │ │ ├── component │ │ │ ├── ComponentBody.tsx │ │ │ ├── ComponentList.module.css │ │ │ ├── ComponentList.tsx │ │ │ ├── ComponentView.module.css │ │ │ ├── ComponentView.tsx │ │ │ ├── HealthLabel.module.css │ │ │ ├── HealthLabel.tsx │ │ │ ├── Table.module.css │ │ │ ├── Table.tsx │ │ │ ├── TableHead.tsx │ │ │ ├── style.ts │ │ │ └── types.ts │ │ ├── graph │ │ │ └── ComponentGraph.tsx │ │ ├── layout │ │ │ ├── Navbar.module.css │ │ │ ├── Navbar.tsx │ │ │ ├── Page.module.css │ │ │ └── Page.tsx │ │ └── river-js │ │ │ ├── RiverValue.module.css │ │ │ ├── RiverValue.tsx │ │ │ ├── stringify.ts │ │ │ └── types.ts │ ├── hooks │ │ ├── componentInfo.tsx │ │ └── peerInfo.tsx │ ├── images │ │ └── logo.svg │ ├── index.css │ ├── index.tsx │ ├── pages │ │ ├── Clustering.tsx │ │ ├── ComponentDetailPage.tsx │ │ ├── Graph.tsx │ │ └── PageComponentList.tsx │ ├── react-app-env.d.ts │ ├── static │ │ ├── fonts.css │ │ └── fonts │ │ │ ├── fira-code-v21-latin-500.woff2 │ │ │ ├── fira-code-v21-latin-regular.woff2 │ │ │ ├── roboto-v30-latin-100.woff2 │ │ │ ├── roboto-v30-latin-100italic.woff2 │ │ │ ├── roboto-v30-latin-300.woff2 │ │ │ ├── roboto-v30-latin-300italic.woff2 │ │ │ ├── roboto-v30-latin-500.woff2 │ │ │ ├── roboto-v30-latin-500italic.woff2 │ │ │ ├── roboto-v30-latin-700.woff2 │ │ │ ├── roboto-v30-latin-700italic.woff2 │ │ │ ├── roboto-v30-latin-900.woff2 │ │ │ ├── roboto-v30-latin-900italic.woff2 │ │ │ ├── roboto-v30-latin-italic.woff2 │ │ │ └── roboto-v30-latin-regular.woff2 │ └── utils │ │ ├── id.ts │ │ └── partition.ts │ ├── tsconfig.json │ ├── ui.go │ └── yarn.lock ├── operations ├── agent-flow-mixin │ ├── alerts.libsonnet │ ├── alerts │ │ ├── clustering.libsonnet │ │ ├── controller.libsonnet │ │ ├── opentelemetry.libsonnet │ │ └── utils │ │ │ └── alert.jsonnet │ ├── dashboards.libsonnet │ ├── dashboards │ │ ├── cluster-node.libsonnet │ │ ├── cluster-overview.libsonnet │ │ ├── controller.libsonnet │ │ ├── opentelemetry.libsonnet │ │ ├── prometheus.libsonnet │ │ ├── resources.libsonnet │ │ └── utils │ │ │ ├── dashboard.jsonnet │ │ │ └── panel.jsonnet │ ├── grizzly.jsonnet │ ├── grizzly │ │ ├── alerts.jsonnet │ │ └── dashboards.jsonnet │ ├── jsonnetfile.json │ └── mixin.libsonnet ├── agent-static-mixin │ ├── alerts.libsonnet │ ├── config.libsonnet │ ├── dashboards.libsonnet │ ├── debugging.libsonnet │ ├── jsonnetfile.json │ ├── mixin.libsonnet │ └── utils.libsonnet ├── agent-static-operator │ ├── crds │ │ ├── monitoring.coreos.com_podmonitors.yaml │ │ ├── monitoring.coreos.com_probes.yaml │ │ ├── monitoring.coreos.com_servicemonitors.yaml │ │ ├── monitoring.grafana.com_grafanaagents.yaml │ │ ├── monitoring.grafana.com_integrations.yaml │ │ ├── monitoring.grafana.com_logsinstances.yaml │ │ ├── monitoring.grafana.com_metricsinstances.yaml │ │ └── monitoring.grafana.com_podlogs.yaml │ └── templates │ │ └── agent-operator.yaml ├── helm │ ├── Makefile │ ├── README.md │ ├── charts │ │ └── grafana-agent │ │ │ ├── .helmignore │ │ │ ├── CHANGELOG.md │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── README.md.gotmpl │ │ │ ├── charts │ │ │ └── crds │ │ │ │ ├── Chart.yaml │ │ │ │ └── crds │ │ │ │ └── monitoring.grafana.com_podlogs.yaml │ │ │ ├── ci │ │ │ ├── additional-serviceaccount-label-values.yaml │ │ │ ├── clustering-values.yaml │ │ │ ├── controller-volumes-extra-values.yaml │ │ │ ├── create-daemonset-hostnetwork-values.yaml │ │ │ ├── create-daemonset-values.yaml │ │ │ ├── create-deployment-autoscaling-values.yaml │ │ │ ├── create-deployment-values.yaml │ │ │ ├── create-statefulset-autoscaling-values.yaml │ │ │ ├── create-statefulset-values.yaml │ │ │ ├── custom-config-values.yaml │ │ │ ├── default-values-values.yaml │ │ │ ├── enable-servicemonitor-tls-values.yaml │ │ │ ├── enable-servicemonitor-values.yaml │ │ │ ├── envFrom-values.yaml │ │ │ ├── existing-config-values.yaml │ │ │ ├── extra-env-values.yaml │ │ │ ├── extra-ports-values.yaml │ │ │ ├── faro-ingress-values.yaml │ │ │ ├── global-image-pullsecrets-values.yaml │ │ │ ├── global-image-registry-values.yaml │ │ │ ├── initcontainers-values.yaml │ │ │ ├── local-image-pullsecrets-values.yaml │ │ │ ├── local-image-registry-values.yaml │ │ │ ├── nodeselectors-and-tolerations-values.yaml │ │ │ ├── nonroot-values.yaml │ │ │ ├── pod_annotations-values.yaml │ │ │ ├── sidecars-values.yaml │ │ │ ├── static-mode-values.yaml │ │ │ ├── topologyspreadconstraints-values.yaml │ │ │ └── with-digests-values.yaml │ │ │ ├── config │ │ │ ├── example.river │ │ │ └── example.yaml │ │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _config.tpl │ │ │ ├── _helpers.tpl │ │ │ ├── cluster_service.yaml │ │ │ ├── configmap.yaml │ │ │ ├── containers │ │ │ │ ├── _agent.yaml │ │ │ │ └── _watch.yaml │ │ │ ├── controllers │ │ │ │ ├── _pod.yaml │ │ │ │ ├── daemonset.yaml │ │ │ │ ├── deployment.yaml │ │ │ │ └── statefulset.yaml │ │ │ ├── hpa.yaml │ │ │ ├── ingress.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── servicemonitor.yaml │ │ │ └── values.yaml │ ├── cr.yaml │ ├── ct.yaml │ ├── lintconf.yaml │ ├── scripts │ │ └── rebuild-tests.sh │ └── tests │ │ ├── additional-serviceaccount-label │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── clustering │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── cluster_service.yaml │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── statefulset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── controller-volumes-extra │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-daemonset-hostnetwork │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-daemonset │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-deployment-autoscaling │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── deployment.yaml │ │ │ ├── hpa.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-deployment │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── deployment.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-statefulset-autoscaling │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── statefulset.yaml │ │ │ ├── hpa.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── create-statefulset │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── statefulset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── custom-config │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── default-values │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── enable-servicemonitor-tls │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── servicemonitor.yaml │ │ ├── enable-servicemonitor │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ ├── serviceaccount.yaml │ │ │ └── servicemonitor.yaml │ │ ├── envFrom │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── existing-config │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── extra-env │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── extra-ports │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── faro-ingress │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── ingress.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── global-image-pullsecrets │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── global-image-registry │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── initcontainers │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── local-image-pullsecrets │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── local-image-registry │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── nodeselectors-and-tolerations │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── nonroot │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── pod_annotations │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── sidecars │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── static-mode │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── daemonset.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ ├── topologyspreadconstraints │ │ └── grafana-agent │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ ├── controllers │ │ │ └── deployment.yaml │ │ │ ├── rbac.yaml │ │ │ ├── service.yaml │ │ │ └── serviceaccount.yaml │ │ └── with-digests │ │ └── grafana-agent │ │ └── templates │ │ ├── configmap.yaml │ │ ├── controllers │ │ └── daemonset.yaml │ │ ├── rbac.yaml │ │ ├── service.yaml │ │ └── serviceaccount.yaml └── river-jsonnet │ ├── README.md │ ├── builder.jsonnet │ ├── internal │ └── utils.jsonnet │ ├── jsonnetfile.json │ ├── main.libsonnet │ ├── main_test.jsonnet │ └── manifest.jsonnet ├── packaging ├── grafana-agent-flow │ ├── deb │ │ ├── control │ │ │ ├── postinst │ │ │ └── prerm │ │ └── grafana-agent-flow.service │ ├── environment-file │ ├── grafana-agent-flow.river │ ├── rpm │ │ ├── control │ │ │ ├── postinst │ │ │ └── prerm │ │ ├── gpg-sign.sh │ │ └── grafana-agent-flow.service │ └── windows │ │ ├── config.river │ │ ├── install_script.nsis │ │ ├── logo.ico │ │ └── macros.nsis └── grafana-agent │ ├── deb │ ├── control │ │ ├── postinst │ │ └── prerm │ └── grafana-agent.service │ ├── environment-file │ ├── grafana-agent.yaml │ ├── rpm │ ├── control │ │ ├── postinst │ │ └── prerm │ ├── gpg-sign.sh │ └── grafana-agent.service │ └── windows │ ├── .gitignore │ ├── Dockerfile │ ├── install_script.nsis │ └── logo.ico ├── static ├── agentctl │ ├── sync.go │ ├── sync_test.go │ ├── testdata │ │ ├── agent-1.yaml │ │ ├── agent-2.yaml │ │ └── agent-3.yaml │ └── waltools │ │ ├── cardinality.go │ │ ├── cardinality_test.go │ │ ├── samples.go │ │ ├── wal_iterator.go │ │ ├── walstats.go │ │ └── walstats_test.go ├── agentproto │ ├── agent.pb.go │ ├── agent.proto │ ├── func.go │ └── gen.go ├── client │ └── client.go ├── config │ ├── agent_management_remote_config_test.go │ ├── agentmanagement.go │ ├── agentmanagement_remote_config.go │ ├── agentmanagement_test.go │ ├── config.go │ ├── config_test.go │ ├── encoder │ │ ├── encoder.go │ │ ├── test_encoding_unknown.txt │ │ ├── test_encoding_utf16be.txt │ │ ├── test_encoding_utf16le.txt │ │ ├── test_encoding_utf32be.txt │ │ ├── test_encoding_utf32le.txt │ │ ├── test_encoding_utf8.txt │ │ └── test_encoding_utf8bom.txt │ ├── features │ │ ├── features.go │ │ └── features_test.go │ ├── instrumentation │ │ ├── agent_management_metrics.go │ │ ├── config_metrics.go │ │ └── remote_config_metrics.go │ ├── integrations.go │ ├── integrations_test.go │ ├── remote_config.go │ ├── remote_config_test.go │ └── testdata │ │ └── server_empty.yml ├── integrations │ ├── agent │ │ └── agent.go │ ├── apache_http │ │ └── apache_http.go │ ├── azure_exporter │ │ ├── azure_exporter.go │ │ ├── config.go │ │ └── config_test.go │ ├── blackbox_exporter │ │ ├── blackbox_exporter.go │ │ └── blackbox_exporter_test.go │ ├── cadvisor │ │ ├── cadvisor.go │ │ ├── cadvisor_stub.go │ │ ├── cadvisor_test.go │ │ └── common.go │ ├── cloudwatch_exporter │ │ ├── cloudwatch_exporter.go │ │ ├── cloudwatch_exporter_decoupled.go │ │ ├── config.go │ │ ├── config_test.go │ │ └── docs │ │ │ ├── doc.go │ │ │ └── template.md │ ├── collector_integration.go │ ├── config │ │ └── config.go │ ├── consul_exporter │ │ └── consul_exporter.go │ ├── dnsmasq_exporter │ │ └── dnsmasq_exporter.go │ ├── elasticsearch_exporter │ │ ├── elasticsearch_exporter.go │ │ └── tls.go │ ├── gcp_exporter │ │ ├── gcp_exporter.go │ │ └── gcp_exporter_test.go │ ├── github_exporter │ │ ├── github_exporter.go │ │ └── github_test.go │ ├── handler_integration.go │ ├── install │ │ ├── install.go │ │ └── install_test.go │ ├── integration.go │ ├── kafka_exporter │ │ ├── kafka_exporter.go │ │ └── kafka_test.go │ ├── logruskit.go │ ├── manager.go │ ├── manager_test.go │ ├── memcached_exporter │ │ └── memcached_exporter.go │ ├── mongodb_exporter │ │ ├── mongodb_exporter.go │ │ └── mongodb_test.go │ ├── mssql │ │ ├── collector.go │ │ ├── collector_config.yaml │ │ ├── collector_test.go │ │ ├── sql_exporter.go │ │ └── sql_exporter_test.go │ ├── mysqld_exporter │ │ ├── mysqld-exporter.go │ │ └── mysqld_test.go │ ├── node_exporter │ │ ├── collectors.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── node_exporter.go │ │ ├── node_exporter_linux.go │ │ ├── node_exporter_test.go │ │ └── node_exporter_windows.go │ ├── oracledb_exporter │ │ ├── oracledb_exporter.go │ │ └── oracledb_exporter_test.go │ ├── postgres_exporter │ │ ├── postgres_exporter.go │ │ ├── postgres_exporter_test.go │ │ └── postgres_test.go │ ├── process_exporter │ │ ├── config.go │ │ ├── process-exporter.go │ │ └── process-exporter_linux.go │ ├── redis_exporter │ │ ├── redis_exporter.go │ │ ├── redis_exporter_test.go │ │ └── testdata │ │ │ └── password_map_file.json │ ├── register.go │ ├── register_test.go │ ├── snmp_exporter │ │ ├── common │ │ │ ├── common.go │ │ │ ├── snmp.yml │ │ │ └── snmp.yml.gz │ │ ├── snmp.go │ │ ├── snmp_exporter.go │ │ └── snmp_exporter_test.go │ ├── snowflake_exporter │ │ ├── snowflake_exporter.go │ │ └── snowflake_exporter_test.go │ ├── squid_exporter │ │ ├── squid_exporter.go │ │ └── squid_exporter_test.go │ ├── statsd_exporter │ │ ├── metrics.go │ │ └── statsd_exporter.go │ ├── stub_integration.go │ ├── v2 │ │ ├── agent │ │ │ └── agent.go │ │ ├── apache_http │ │ │ ├── apache_http.go │ │ │ └── apache_http_test.go │ │ ├── app_agent_receiver │ │ │ ├── app_agent_receiver.go │ │ │ ├── app_agent_receiver_test.go │ │ │ ├── config.go │ │ │ ├── config_test.go │ │ │ ├── handler.go │ │ │ ├── handler_test.go │ │ │ ├── logs_exporter.go │ │ │ ├── logs_exporter_test.go │ │ │ ├── payload.go │ │ │ ├── payload_test.go │ │ │ ├── receiver_metrics_exporter.go │ │ │ ├── receiver_metrics_test.go │ │ │ ├── sourcemaps.go │ │ │ ├── sourcemaps_test.go │ │ │ ├── testdata │ │ │ │ ├── foo.js │ │ │ │ ├── foo.js.map │ │ │ │ ├── payload.json │ │ │ │ └── payload_2.json │ │ │ ├── traces_exporter.go │ │ │ ├── traces_test.go │ │ │ ├── utils.go │ │ │ └── utils_test.go │ │ ├── autoscrape │ │ │ ├── appender.go │ │ │ ├── autoscrape.go │ │ │ └── autoscrape_test.go │ │ ├── blackbox_exporter │ │ │ ├── blackbox.go │ │ │ ├── blackbox_exporter.go │ │ │ └── blackbox_test.go │ │ ├── common │ │ │ └── metrics.go │ │ ├── controller.go │ │ ├── controller_httpintegration_test.go │ │ ├── controller_metricsintegration_test.go │ │ ├── controller_test.go │ │ ├── controller_updateintegration_test.go │ │ ├── eventhandler │ │ │ ├── eventhandler.go │ │ │ ├── eventhandler_test.go │ │ │ ├── integration.go │ │ │ └── testdata │ │ │ │ └── eventhandler.cache │ │ ├── integrations.go │ │ ├── metricsutils │ │ │ ├── metricshandler_integration.go │ │ │ ├── metricshandler_integration_test.go │ │ │ └── versionshim.go │ │ ├── register.go │ │ ├── register_test.go │ │ ├── snmp_exporter │ │ │ ├── snmp.go │ │ │ ├── snmp_exporter.go │ │ │ └── snmp_exporter_test.go │ │ ├── subsystem.go │ │ ├── subsystem_test.go │ │ ├── targetgroup.go │ │ ├── utils.go │ │ ├── vmware_exporter │ │ │ └── vmware_exporter.go │ │ └── workers.go │ ├── vmware_exporter │ │ └── vmware_exporter.go │ └── windows_exporter │ │ ├── config.go │ │ ├── config_windows.go │ │ ├── windows_exporter.go │ │ └── windows_exporter_windows.go ├── logs │ ├── config.go │ ├── config_test.go │ ├── global.go │ ├── http.go │ ├── http_test.go │ ├── logs.go │ └── logs_test.go ├── metrics │ ├── agent.go │ ├── agent_test.go │ ├── cleaner.go │ ├── cleaner_test.go │ ├── cluster │ │ ├── client │ │ │ └── client.go │ │ ├── cluster.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── config_watcher.go │ │ ├── config_watcher_test.go │ │ ├── configapi │ │ │ └── types.go │ │ ├── node.go │ │ ├── node_test.go │ │ ├── validation.go │ │ └── validation_test.go │ ├── http.go │ ├── http_test.go │ ├── instance │ │ ├── configstore │ │ │ ├── api.go │ │ │ ├── api_test.go │ │ │ ├── codec.go │ │ │ ├── codec_test.go │ │ │ ├── errors.go │ │ │ ├── mock.go │ │ │ ├── remote.go │ │ │ ├── remote_test.go │ │ │ ├── store.go │ │ │ └── unique.go │ │ ├── errors.go │ │ ├── global.go │ │ ├── group_manager.go │ │ ├── group_manager_test.go │ │ ├── host_filter.go │ │ ├── host_filter_test.go │ │ ├── instance.go │ │ ├── instance_integration_test.go │ │ ├── instance_test.go │ │ ├── manager.go │ │ ├── manager_test.go │ │ ├── marshal.go │ │ ├── marshal_test.go │ │ ├── modal_manager.go │ │ └── noop.go │ └── wal │ │ ├── series.go │ │ ├── util.go │ │ ├── wal.go │ │ └── wal_test.go ├── operator │ ├── apis │ │ └── monitoring │ │ │ ├── doc.go │ │ │ └── v1alpha1 │ │ │ ├── deployment.go │ │ │ ├── doc.go │ │ │ ├── group.go │ │ │ ├── types.go │ │ │ ├── types_integrations.go │ │ │ ├── types_logs.go │ │ │ ├── types_metrics.go │ │ │ └── zz_generated.deepcopy.go │ ├── assets │ │ └── assets.go │ ├── build_hierarchy.go │ ├── build_hierarchy_test.go │ ├── clientutil │ │ ├── clientutil.go │ │ └── merge.go │ ├── config │ │ ├── config.go │ │ ├── config_references.go │ │ ├── config_references_test.go │ │ ├── config_test.go │ │ ├── fs_importer.go │ │ ├── integration_templates_test.go │ │ ├── logs_templates_test.go │ │ ├── metrics_templates_test.go │ │ ├── templates │ │ │ ├── agent-integrations.libsonnet │ │ │ ├── agent-logs.libsonnet │ │ │ ├── agent-metrics.libsonnet │ │ │ ├── component │ │ │ │ ├── logs │ │ │ │ │ ├── client.libsonnet │ │ │ │ │ ├── external_labels.libsonnet │ │ │ │ │ ├── pod_logs.libsonnet │ │ │ │ │ ├── relabel_config.libsonnet │ │ │ │ │ └── stages.libsonnet │ │ │ │ └── metrics │ │ │ │ │ ├── external_labels.libsonnet │ │ │ │ │ ├── kube_sd_config.libsonnet │ │ │ │ │ ├── pod_monitor.libsonnet │ │ │ │ │ ├── probe.libsonnet │ │ │ │ │ ├── relabel_config.libsonnet │ │ │ │ │ ├── remote_write.libsonnet │ │ │ │ │ ├── safe_tls_config.libsonnet │ │ │ │ │ ├── service_monitor.libsonnet │ │ │ │ │ └── tls_config.libsonnet │ │ │ ├── ext │ │ │ │ ├── marshal.libsonnet │ │ │ │ ├── optionals.libsonnet │ │ │ │ └── secrets.libsonnet │ │ │ ├── integrations.libsonnet │ │ │ ├── logs.libsonnet │ │ │ ├── metrics.libsonnet │ │ │ └── utils │ │ │ │ └── k8s.libsonnet │ │ ├── utils.go │ │ └── utils_test.go │ ├── defaults.go │ ├── defaults.go.t │ ├── hierarchy │ │ ├── hierarchy.go │ │ ├── hierarchy_test.go │ │ ├── list.go │ │ └── selector.go │ ├── kubelet.go │ ├── kubelet_test.go │ ├── logutil │ │ └── log.go │ ├── operator.go │ ├── operator_test.go │ ├── reconciler.go │ ├── reconciler_integrations.go │ ├── reconciler_integrations_test.go │ ├── reconciler_logs.go │ ├── reconciler_metrics.go │ ├── resources_integrations.go │ ├── resources_logs.go │ ├── resources_metrics.go │ ├── resources_metrics_test.go │ ├── resources_pod_template.go │ ├── resources_pod_template_test.go │ └── testdata │ │ ├── test-custom-mounts.in.yaml │ │ ├── test-custom-mounts.out.yaml │ │ ├── test-integrations.in.yaml │ │ ├── test-integrations.out.yaml │ │ ├── test-metrics-instance.in.yaml │ │ ├── test-metrics-instance.out.yaml │ │ └── test-resource-hierarchy.yaml ├── server │ ├── config.go │ ├── config_test.go │ ├── flags.go │ ├── logger.go │ ├── logger_test.go │ ├── logger_windows.go │ ├── server.go │ ├── server_test.go │ ├── signal_context.go │ ├── testdata │ │ ├── example-cert.pem │ │ ├── example-key.pem │ │ └── windows │ │ │ ├── CLIENT_CA_CERT.cer │ │ │ ├── README.md │ │ │ ├── agent-config.yml │ │ │ ├── client_cert.crt │ │ │ ├── client_cert.pfx │ │ │ ├── client_key.key │ │ │ ├── client_key_unencrypted.key │ │ │ └── server_cert.crt │ ├── tls.go │ ├── tls_certstore_stub.go │ ├── tls_certstore_windows.go │ ├── tls_certstore_windows_test.go │ └── tls_test.go ├── supportbundle │ └── supportbundle.go └── traces │ ├── automaticloggingprocessor │ ├── automaticloggingprocessor.go │ ├── automaticloggingprocessor_test.go │ └── factory.go │ ├── config.go │ ├── config_test.go │ ├── contextkeys │ └── keys.go │ ├── instance.go │ ├── noopreceiver │ ├── factory.go │ └── receiver.go │ ├── promsdprocessor │ ├── consumer │ │ ├── consumer.go │ │ └── consumer_test.go │ ├── factory.go │ ├── prom_sd_processor.go │ └── prom_sd_processor_test.go │ ├── pushreceiver │ ├── factory.go │ └── receiver.go │ ├── remotewriteexporter │ ├── exporter.go │ ├── exporter_test.go │ └── factory.go │ ├── servicegraphprocessor │ ├── factory.go │ ├── processor.go │ ├── processor_test.go │ ├── store.go │ ├── store_test.go │ └── testdata │ │ ├── trace-sample.json │ │ └── unpaired-trace-sample.json │ ├── traces.go │ ├── traces_test.go │ └── traceutils │ ├── otel_meter_settings.go │ └── server.go └── tools ├── ci ├── docker-containers └── docker-containers-windows ├── gen-crd-docs ├── config.json └── template │ ├── members.tpl │ ├── pkg.tpl │ └── type.tpl ├── gen-versioned-files ├── agent-version.txt └── gen-versioned-files.sh ├── generate-crds.bash ├── image-tag ├── make ├── build-container.mk └── packaging.mk ├── release └── release-note.md /.dockerignore: -------------------------------------------------------------------------------- 1 | build/ 2 | data/ 3 | data-agent/ 4 | dist/ 5 | web/ui/node_modules/ 6 | web/ui/build/ 7 | packaging/windows/LICENSE 8 | packaging/windows/agent-windows-amd64.exe 9 | cmd/grafana-agent/Dockerfile -------------------------------------------------------------------------------- /.drone/drone.jsonnet: -------------------------------------------------------------------------------- 1 | local pipelines = import './pipelines.jsonnet'; 2 | 3 | (import 'pipelines/build_images.jsonnet') + 4 | (import 'pipelines/test.jsonnet') + 5 | (import 'pipelines/check_containers.jsonnet') + 6 | (import 'pipelines/crosscompile.jsonnet') + 7 | (import 'pipelines/publish.jsonnet') + 8 | (import 'pipelines/test_packages.jsonnet') + 9 | (import 'util/secrets.jsonnet').asList 10 | -------------------------------------------------------------------------------- /.drone/util/build_image.jsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local version = std.extVar('BUILD_IMAGE_VERSION'), 3 | 4 | linux: 'grafana/agent-build-image:%s' % version, 5 | windows: 'grafana/agent-build-image:%s-windows' % version, 6 | boringcrypto: 'grafana/agent-build-image:%s-boringcrypto' % version, 7 | } 8 | -------------------------------------------------------------------------------- /.drone/util/pipelines.jsonnet: -------------------------------------------------------------------------------- 1 | { 2 | linux(name):: { 3 | kind: 'pipeline', 4 | type: 'docker', 5 | name: name, 6 | platform: { 7 | os: 'linux', 8 | arch: 'amd64', 9 | }, 10 | }, 11 | 12 | windows(name):: { 13 | kind: 'pipeline', 14 | type: 'docker', 15 | name: name, 16 | platform: { 17 | arch: 'amd64', 18 | os: 'windows', 19 | version: '1809', 20 | }, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | pkg/operator/crds/*.yaml linguist-generated=true 2 | 3 | *.txtar text eol=lf -------------------------------------------------------------------------------- /.github/workflows/autolock.yml: -------------------------------------------------------------------------------- 1 | name: Lock closed issues and PRs 2 | on: 3 | workflow_dispatch: {} 4 | schedule: 5 | - cron: '0 0 * * *' 6 | 7 | permissions: 8 | issues: write 9 | pull-requests: write 10 | discussions: write 11 | 12 | concurrency: 13 | group: lock-threads 14 | 15 | jobs: 16 | action: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5 20 | with: 21 | pr-inactive-days: 30 22 | issue-inactive-days: 30 23 | add-issue-labels: 'frozen-due-to-age' 24 | add-pr-labels: 'frozen-due-to-age' 25 | process-only: 'issues, prs' 26 | -------------------------------------------------------------------------------- /.github/workflows/depcheck.yml: -------------------------------------------------------------------------------- 1 | name: Check Dependencies 2 | on: 3 | workflow_dispatch: {} 4 | schedule: 5 | - cron: '0 0 * * *' 6 | permissions: 7 | contents: read 8 | jobs: 9 | check: 10 | name: Check 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 15 | with: 16 | persist-credentials: false 17 | 18 | - name: Invoke action 19 | uses: rfratto/depcheck@95f3e3d75101f21e73363c928d500a222cf03572 # main 20 | with: 21 | github-token: ${{ secrets.MANAGE_ISSUES_GH_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/scripts.yml: -------------------------------------------------------------------------------- 1 | name: Lint Scripts 2 | on: [pull_request] 3 | permissions: 4 | contents: read 5 | jobs: 6 | shellcheck: 7 | name: Shellcheck 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 11 | with: 12 | persist-credentials: false 13 | - uses: azohra/shell-linter@6bbeaa868df09c34ddc008e6030cfe89c03394a1 # latest 14 | with: 15 | path: "packaging,production,tools/ci,tools/release,docs/sources/flow/tutorials/assets" 16 | -------------------------------------------------------------------------------- /.github/workflows/snyk.yml: -------------------------------------------------------------------------------- 1 | name: Snyk Monitor Scanning 2 | on: 3 | release: 4 | types: [published] 5 | push: 6 | branches: 7 | - 'main' 8 | - 'master' 9 | workflow_dispatch: 10 | 11 | permissions: 12 | contents: read 13 | 14 | jobs: 15 | snyk-scan-ci: 16 | uses: 'grafana/security-github-actions/.github/workflows/snyk_monitor.yml@ae330403c3a5a8b6aaa653ce6f3d059b3a772488' # main 17 | secrets: 18 | SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.rpmdb/ 2 | /.idea 3 | /.published 4 | /.pkg 5 | /.cache 6 | /.vscode 7 | /.eventcache 8 | vendor 9 | data-agent 10 | 11 | /cmd/agent/agent 12 | /cmd/agentctl/agentctl 13 | /cmd/agent-operator/agent-operator 14 | /cmd/grafana-agent-crow/grafana-agent-crow 15 | /build/ 16 | /dist/ 17 | /dist.temp/ 18 | /packaging/windows/LICENSE 19 | /packaging/windows/agent-windows-amd64.exe 20 | web/ui/build 21 | 22 | .DS_Store 23 | buildx-v* 24 | cover*.out 25 | .uptodate 26 | node_modules 27 | 28 | /docs/variables.mk.local 29 | -------------------------------------------------------------------------------- /ADOPTERS.md: -------------------------------------------------------------------------------- 1 | This is the list of organizations, organized alphabetically, that are using the Grafana Agent in 2 | production environments. Please send PRs to add or remove organizations. 3 | 4 | * [AB Tasty](https://www.abtasty.com/) 5 | * [Canonical](https://www.ubuntu.com/) 6 | * Cerner Enterprise Hosting 7 | * [CLOUDETEER GmbH](https://www.cloudeteer.de/) 8 | * [Embark Studios](https://www.embark.dev/) 9 | * [Grafana Labs](https://grafana.com) 10 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | The primary maintainers of the codebase are the list of team members in 2 | [GOVERNANCE](./GOVERNANCE.md). 3 | 4 | Some parts of the codebase have other maintainers based on GitHub groups. Refer 5 | to [CODEOWNERS](./CODEOWNERS) for which groups own which subtrees. 6 | -------------------------------------------------------------------------------- /cmd/grafana-agent-service/doc.go: -------------------------------------------------------------------------------- 1 | // Command grafana-agent-service is a Windows binary which manages Grafana 2 | // Agent as a Windows service. 3 | package main 4 | -------------------------------------------------------------------------------- /cmd/grafana-agent/agent-local-config.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: info 3 | 4 | metrics: 5 | global: 6 | scrape_interval: 1m 7 | configs: 8 | - name: test 9 | host_filter: false 10 | scrape_configs: 11 | - job_name: local_scrape 12 | static_configs: 13 | - targets: ['127.0.0.1:12345'] 14 | labels: 15 | cluster: 'localhost' 16 | remote_write: 17 | - url: http://localhost:9009/api/prom/push 18 | -------------------------------------------------------------------------------- /cmd/grafana-agent/mode.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | type runMode int8 9 | 10 | const ( 11 | runModeInvalid runMode = iota 12 | runModeStatic 13 | runModeFlow 14 | ) 15 | 16 | func getRunMode() (runMode, error) { 17 | key, found := os.LookupEnv("AGENT_MODE") 18 | if !found { 19 | return runModeStatic, nil 20 | } 21 | 22 | switch key { 23 | case "flow": 24 | return runModeFlow, nil 25 | case "static", "": 26 | return runModeStatic, nil 27 | default: 28 | return runModeInvalid, fmt.Errorf("unrecognized run mode %q", key) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cmd/grafana-agent/run-config.river: -------------------------------------------------------------------------------- 1 | server { 2 | http { 3 | listen_addr = "127.0.0.1:12381" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /cmd/grafana-agent/service.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package main 4 | 5 | // IsWindowsService returns whether the current process is running as a Windows 6 | // Service. On non-Windows platforms, this always returns false. 7 | func IsWindowsService() bool { 8 | return false 9 | } 10 | 11 | // RunService runs the current process as a Windows service. On non-Windows platforms, 12 | // this is always a no-op. 13 | func RunService() error { 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /docs/developer/release/7-test-release.md: -------------------------------------------------------------------------------- 1 | # Test Release 2 | 3 | Validate the new version is working by running it. 4 | 5 | ## Steps 6 | 7 | 1. Validate performance metrics are consistent with the prior version. 8 | 9 | 2. Validate Flow components are healthy. -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/additional_services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/additional_services.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/addroles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/addroles.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/any_purpose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/any_purpose.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/availability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/availability.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/certificate_authority_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/certificate_authority_click.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/certificate_templates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/certificate_templates.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/certificateservices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/certificateservices.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/common_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/common_name.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/config.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/configure_certificate_authority.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/configure_certificate_authority.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/default_certificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/default_certificate.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/default_identity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/default_identity.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/default_private_ky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/default_private_ky.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/enterprise_ca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/enterprise_ca.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/export_private_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/export_private_key.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/exportable_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/exportable_key.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/give_control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/give_control.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/initial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/initial.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/manage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/manage.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/new_cert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/new_cert.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/new_cert_exportable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/new_cert_exportable.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/object_identifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/object_identifier.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/private_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/private_key.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/root_ca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/root_ca.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/template_general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/template_general.png -------------------------------------------------------------------------------- /docs/developer/windows/certificate_store/images/validity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/developer/windows/certificate_store/images/validity.png -------------------------------------------------------------------------------- /docs/rfcs/0000-template.md: -------------------------------------------------------------------------------- 1 | # Title 2 | 3 | * Date: YYYY-MM-DD 4 | * Author: Full Name (@github_username) 5 | * PR: [grafana/agent#XXXX](https://github.com/grafana/agent/pull/XXXX) 6 | -------------------------------------------------------------------------------- /docs/sources/assets/logo_and_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/logo_and_name.png -------------------------------------------------------------------------------- /docs/sources/assets/tasks/loki-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/tasks/loki-config.png -------------------------------------------------------------------------------- /docs/sources/assets/tasks/otlp-lgtm-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/tasks/otlp-lgtm-graph.png -------------------------------------------------------------------------------- /docs/sources/assets/tasks/prometheus-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/tasks/prometheus-config.png -------------------------------------------------------------------------------- /docs/sources/assets/tasks/tempo-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/tasks/tempo-config.png -------------------------------------------------------------------------------- /docs/sources/assets/ui_clustering_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/ui_clustering_page.png -------------------------------------------------------------------------------- /docs/sources/assets/ui_component_detail_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/ui_component_detail_page.png -------------------------------------------------------------------------------- /docs/sources/assets/ui_graph_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/ui_graph_page.png -------------------------------------------------------------------------------- /docs/sources/assets/ui_home_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/docs/sources/assets/ui_home_page.png -------------------------------------------------------------------------------- /docs/sources/flow/concepts/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | aliases: 3 | - ../concepts/ 4 | - /docs/grafana-cloud/agent/flow/concepts/ 5 | - /docs/grafana-cloud/monitor-infrastructure/agent/flow/concepts/ 6 | - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/concepts/ 7 | - /docs/grafana-cloud/send-data/agent/flow/concepts/ 8 | canonical: https://grafana.com/docs/agent/latest/flow/concepts/ 9 | description: Learn about the Grafana Agent Flow concepts 10 | title: Concepts 11 | weight: 100 12 | --- 13 | 14 | # Concepts 15 | 16 | This section explains the primary concepts of {{< param "PRODUCT_NAME" >}}. 17 | 18 | {{< section >}} 19 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | aliases: 3 | - /docs/grafana-cloud/agent/flow/tutorials/ 4 | - /docs/grafana-cloud/monitor-infrastructure/agent/flow/tutorials/ 5 | - /docs/grafana-cloud/monitor-infrastructure/integrations/agent/flow/tutorials/ 6 | - /docs/grafana-cloud/send-data/agent/flow/tutorials/ 7 | canonical: https://grafana.com/docs/agent/latest/flow/tutorials/ 8 | description: Learn how to use Grafana Agent Flow 9 | title: Tutorials 10 | weight: 300 11 | --- 12 | 13 | # Tutorials 14 | 15 | This section provides tutorials for learning how to use {{< param "PRODUCT_NAME" >}}. 16 | 17 | {{< section >}} 18 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/assets/flow_configs/example.river: -------------------------------------------------------------------------------- 1 | prometheus.exporter.unix "default" { 2 | set_collectors = ["cpu", "diskstats"] 3 | } 4 | 5 | prometheus.scrape "my_scrape_job" { 6 | targets = prometheus.exporter.unix.default.targets 7 | forward_to = [prometheus.remote_write.default.receiver] 8 | } 9 | 10 | prometheus.remote_write "default" { 11 | endpoint { 12 | url = "http://mimir:9009/api/v1/push" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/assets/grafana/config/grafana.ini: -------------------------------------------------------------------------------- 1 | [analytics] 2 | reporting_enabled = false 3 | [auth.anonymous] 4 | enabled = true 5 | org_role = Admin 6 | [explore] 7 | enabled = true 8 | [users] 9 | default_theme = dark 10 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/assets/grafana/dashboards-provisioning/dashboards.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: 'dashboards' 5 | orgId: 1 6 | folder: '' 7 | folderUid: '' 8 | type: file 9 | disableDeletion: true 10 | editable: true 11 | updateIntervalSeconds: 10 12 | allowUiUpdates: false 13 | options: 14 | path: /var/lib/grafana/dashboards 15 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/assets/grafana/dashboards/template.jsonnet: -------------------------------------------------------------------------------- 1 | local agentDashboards = import 'grafana-agent-mixin/dashboards.libsonnet'; 2 | local agentDebugging = import 'grafana-agent-mixin/debugging.libsonnet'; 3 | 4 | local result = agentDashboards + agentDebugging { 5 | files: { 6 | [name]: $.grafanaDashboards[name] { 7 | // Use local timezone for local testing 8 | timezone: '', 9 | } 10 | for name in std.objectFields($.grafanaDashboards) 11 | }, 12 | }; 13 | 14 | result.files 15 | -------------------------------------------------------------------------------- /docs/sources/flow/tutorials/assets/grafana/datasources/datasource.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | deleteDatasources: 4 | - name: Mimir 5 | 6 | datasources: 7 | - name: Mimir 8 | type: prometheus 9 | access: proxy 10 | orgId: 1 11 | url: http://mimir:9009/prometheus 12 | basicAuth: false 13 | isDefault: false 14 | version: 1 15 | editable: false -------------------------------------------------------------------------------- /docs/sources/shared/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | aliases: 3 | - /docs/grafana-cloud/monitor-infrastructure/agent/shared/ 4 | - /docs/grafana-cloud/send-data/agent/shared/ 5 | canonical: https://grafana.com/docs/agent/latest/shared/ 6 | description: Shared content 7 | headless: true 8 | --- 9 | 10 | -------------------------------------------------------------------------------- /docs/sources/static/set-up/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | aliases: 3 | - ../set-up/ 4 | - /docs/grafana-cloud/monitor-infrastructure/agent/static/set-up/ 5 | - /docs/grafana-cloud/send-data/agent/static/set-up/ 6 | canonical: https://grafana.com/docs/agent/latest/static/set-up/ 7 | description: Learn how to set up Grafana Agent in static mode 8 | menuTitle: Set up static mode 9 | title: Set up Grafana Agent in static mode 10 | weight: 100 11 | --- 12 | 13 | # Set up Grafana Agent in static mode 14 | 15 | This section includes information that helps you get Grafana Agent in static mode installed and configured. 16 | 17 | {{< section >}} 18 | -------------------------------------------------------------------------------- /docs/variables.mk: -------------------------------------------------------------------------------- 1 | # List of projects to provide to the make-docs script. 2 | # Format is PROJECT[:[VERSION][:[REPOSITORY][:[DIRECTORY]]]] 3 | # The following PROJECTS value mounts content into the agent project, at the "latest" version, which is the default if not explicitly set. 4 | # This results in the content being served at /docs/agent/latest/. 5 | # The source of the content is the current repository which is determined by the name of the parent directory of the git root. 6 | # This overrides the default behavior of assuming the repository directory is the same as the project name. 7 | PROJECTS := agent::$(notdir $(basename $(shell git rev-parse --show-toplevel))) 8 | -------------------------------------------------------------------------------- /example/docker-compose/grafana/config/grafana.ini: -------------------------------------------------------------------------------- 1 | [analytics] 2 | reporting_enabled = false 3 | [auth.anonymous] 4 | enabled = true 5 | org_role = Admin 6 | [explore] 7 | enabled = true 8 | [users] 9 | default_theme = dark 10 | -------------------------------------------------------------------------------- /example/docker-compose/grafana/dashboards-provisioning/dashboards.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | providers: 4 | - name: 'dashboards' 5 | orgId: 1 6 | folder: '' 7 | folderUid: '' 8 | type: file 9 | disableDeletion: true 10 | editable: true 11 | updateIntervalSeconds: 10 12 | allowUiUpdates: false 13 | options: 14 | path: /var/lib/grafana/dashboards 15 | -------------------------------------------------------------------------------- /example/docker-compose/grafana/dashboards/template.jsonnet: -------------------------------------------------------------------------------- 1 | local agentDashboards = import 'agent-static-mixin/dashboards.libsonnet'; 2 | local agentDebugging = import 'agent-static-mixin/debugging.libsonnet'; 3 | 4 | local result = agentDashboards + agentDebugging { 5 | files: { 6 | [name]: $.grafanaDashboards[name] { 7 | // Use local timezone for local testing 8 | timezone: '', 9 | } 10 | for name in std.objectFields($.grafanaDashboards) 11 | }, 12 | }; 13 | 14 | result.files 15 | -------------------------------------------------------------------------------- /example/docker-compose/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": [ 4 | { 5 | "source": { 6 | "local": { 7 | "directory": "../../operations/agent-static-mixin" 8 | } 9 | }, 10 | "version": "" 11 | } 12 | ], 13 | "legacyImports": true 14 | } 15 | -------------------------------------------------------------------------------- /internal/boringcrypto/disabled.go: -------------------------------------------------------------------------------- 1 | //go:build !(fips || boringcrypto || cngcrypto) 2 | 3 | // fips https://boringssl.googlesource.com/boringssl/+/master/crypto/fipsmodule/FIPS.md 4 | // fips and boringcrytpo are for enabling via linux experiment using the goexperiment=boringcrytpo flag 5 | // cngcrypto is used for windows builds that use https://github.com/microsoft/go fork, and is passed has a tag and experiment. 6 | 7 | package boringcrypto 8 | 9 | const Enabled = false 10 | -------------------------------------------------------------------------------- /internal/boringcrypto/enabled.go: -------------------------------------------------------------------------------- 1 | //go:build fips || boringcrypto || cngcrypto 2 | 3 | // fips https://boringssl.googlesource.com/boringssl/+/master/crypto/fipsmodule/FIPS.md 4 | // fips and boringcrytpo are for enabling via linux experiment using the goexperiment=boringcrytpo flag 5 | // cngcrypto is used for windows builds that use https://github.com/microsoft/go fork, and is passed has a tag and experiment. 6 | 7 | package boringcrypto 8 | 9 | // Package fipsonly restricts all TLS configuration to boringcrypto settings. 10 | import _ "crypto/tls/fipsonly" 11 | 12 | const Enabled = true 13 | -------------------------------------------------------------------------------- /internal/cmd/agentlint/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/grafana/agent/internal/cmd/agentlint 2 | 3 | go 1.21 4 | 5 | require golang.org/x/tools v0.17.0 6 | 7 | require golang.org/x/mod v0.14.0 // indirect 8 | -------------------------------------------------------------------------------- /internal/cmd/agentlint/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= 2 | golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 3 | golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= 4 | golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 5 | golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= 6 | golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= 7 | -------------------------------------------------------------------------------- /internal/cmd/agentlint/main.go: -------------------------------------------------------------------------------- 1 | // Command agentlint provides custom linting utilities for the grafana/agent 2 | // repo. 3 | package main 4 | 5 | import ( 6 | "github.com/grafana/agent/internal/cmd/agentlint/internal/findcomponents" 7 | "github.com/grafana/agent/internal/cmd/agentlint/internal/rivertags" 8 | "golang.org/x/tools/go/analysis/multichecker" 9 | ) 10 | 11 | func main() { 12 | multichecker.Main( 13 | findcomponents.Analyzer, 14 | rivertags.Analyzer, 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/common/log.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "encoding/json" 4 | 5 | type LogResponse struct { 6 | Status string `json:"status"` 7 | Data struct { 8 | ResultType string `json:"resultType"` 9 | Result []LogData `json:"result"` 10 | } `json:"data"` 11 | } 12 | 13 | type LogData struct { 14 | Stream map[string]string `json:"stream"` 15 | Values [][2]string `json:"values"` 16 | } 17 | 18 | func (m *LogResponse) Unmarshal(data []byte) error { 19 | return json.Unmarshal(data, m) 20 | } 21 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/configs/kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24.2 as build 2 | WORKDIR /app/ 3 | COPY go.mod go.sum ./ 4 | RUN go mod download 5 | COPY ./internal/cmd/integration-tests/configs/kafka/ ./ 6 | RUN CGO_ENABLED=0 go build -o main main.go 7 | FROM alpine:3.18 8 | COPY --from=build /app/main /app/main 9 | CMD ["/app/main"] 10 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/configs/otel-metrics-gen/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24.2 as build 2 | WORKDIR /app/ 3 | COPY go.mod go.sum ./ 4 | RUN go mod download 5 | COPY ./internal/cmd/integration-tests/configs/otel-metrics-gen/ ./ 6 | RUN CGO_ENABLED=0 go build -o main main.go 7 | FROM alpine:3.18 8 | COPY --from=build /app/main /app/main 9 | CMD ["/app/main"] 10 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/configs/prom-gen/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24.2 as build 2 | WORKDIR /app/ 3 | COPY go.mod go.sum ./ 4 | RUN go mod download 5 | COPY ./internal/cmd/integration-tests/configs/prom-gen/ ./ 6 | RUN CGO_ENABLED=0 go build -o main main.go 7 | FROM alpine:3.18 8 | COPY --from=build /app/main /app/main 9 | CMD ["/app/main"] 10 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/tests/otlp-metrics/otlp_metrics_test.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package main 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/grafana/agent/internal/cmd/integration-tests/common" 9 | ) 10 | 11 | func TestOTLPMetrics(t *testing.T) { 12 | common.MimirMetricsTest(t, common.OtelDefaultMetrics, common.OtelDefaultHistogramMetrics, "otlp_metrics") 13 | } 14 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/tests/read-log-file/config.river: -------------------------------------------------------------------------------- 1 | loki.source.file "test" { 2 | targets = [ 3 | {__path__ = "logs.txt"}, 4 | ] 5 | forward_to = [loki.write.test.receiver] 6 | } 7 | 8 | loki.write "test" { 9 | endpoint { 10 | url = "http://localhost:3100/loki/api/v1/push" 11 | } 12 | external_labels = { 13 | test_name = "read_log_file", 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/tests/scrape-prom-metrics/scrape_prom_metrics_test.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package main 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/grafana/agent/internal/cmd/integration-tests/common" 9 | ) 10 | 11 | func TestScrapePromMetrics(t *testing.T) { 12 | common.MimirMetricsTest(t, common.PromDefaultMetrics, common.PromDefaultHistogramMetric, "scrape_prom_metrics") 13 | } 14 | -------------------------------------------------------------------------------- /internal/cmd/integration-tests/tests/unix/config.river: -------------------------------------------------------------------------------- 1 | prometheus.exporter.unix "node_exporter" { } 2 | 3 | prometheus.scrape "demo" { 4 | targets = prometheus.exporter.unix.node_exporter.targets 5 | forward_to = [prometheus.remote_write.node_exporter.receiver] 6 | scrape_interval = "1s" 7 | scrape_timeout = "500ms" 8 | } 9 | 10 | prometheus.remote_write "node_exporter" { 11 | endpoint { 12 | url = "http://localhost:9009/api/v1/push" 13 | metadata_config { 14 | send_interval = "1s" 15 | } 16 | queue_config { 17 | max_samples_per_send = 100 18 | } 19 | } 20 | external_labels = { 21 | test_name = "unix_metrics", 22 | } 23 | } -------------------------------------------------------------------------------- /internal/cmd/rivereval/example.river: -------------------------------------------------------------------------------- 1 | env("HOME") 2 | -------------------------------------------------------------------------------- /internal/component/common/kubernetes/rules_test.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "testing" 5 | 6 | "k8s.io/client-go/util/workqueue" 7 | ) 8 | 9 | func TestEventTypeIsHashable(t *testing.T) { 10 | // This test is here to ensure that the EventType type is hashable according to the workqueue implementation 11 | queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) 12 | queue.AddRateLimited(Event{}) 13 | } 14 | -------------------------------------------------------------------------------- /internal/component/common/loki/positions/write_positions_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package positions 4 | 5 | // This code is copied from Promtail. The positions package allows logging 6 | // components to keep track of read file offsets on disk and continue from the 7 | // same place in case of a restart. 8 | 9 | import ( 10 | "bytes" 11 | 12 | "github.com/natefinch/atomic" 13 | yaml "gopkg.in/yaml.v2" 14 | ) 15 | 16 | func writePositionFile(filename string, positions map[Entry]string) error { 17 | buf, err := yaml.Marshal(File{ 18 | Positions: positions, 19 | }) 20 | if err != nil { 21 | return err 22 | } 23 | return atomic.WriteFile(filename, bytes.NewReader(buf)) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /internal/component/common/loki/utils/convert.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "github.com/prometheus/common/model" 4 | 5 | // ToLabelSet converts a map of strings to a prometheus LabelSet. 6 | func ToLabelSet(in map[string]string) model.LabelSet { 7 | res := make(model.LabelSet, len(in)) 8 | for k, v := range in { 9 | res[model.LabelName(k)] = model.LabelValue(v) 10 | } 11 | return res 12 | } 13 | -------------------------------------------------------------------------------- /internal/component/loki/process/stages/testdata/geoip_maxmind_asn.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/process/stages/testdata/geoip_maxmind_asn.mmdb -------------------------------------------------------------------------------- /internal/component/loki/process/stages/testdata/geoip_maxmind_city.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/process/stages/testdata/geoip_maxmind_city.mmdb -------------------------------------------------------------------------------- /internal/component/loki/process/stages/testdata/geoip_maxmind_country.mmdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/process/stages/testdata/geoip_maxmind_country.mmdb -------------------------------------------------------------------------------- /internal/component/loki/source/aws_firehose/internal/testdata/cw_logs_control_and_bad_records.json: -------------------------------------------------------------------------------- 1 | { 2 | "requestId": "86208cf6-2bcc-47e6-9010-02ca9f44a025", 3 | "timestamp": 1684424042901, 4 | "records": [ 5 | { 6 | "data": "H4sIAAAAAAAAADWO0QqCMBiFX2XsWsJSwrwLUW8sIYUuQmLpnxvpJttMQnz3Ztrlxzmc8424BaVIDfmnA+zjID3nlzS5n8IsO8YhtrAYOMg5aURfDUSXNBG1MkEj6liKvjPZQpmWQNoFVf9QpWSdZoJHrNEgFfZvxa8XvoHrGUfMqqWumdHQpDVj273nujvn4Nm251h/vVngmqBVD616PgoolC/Ga0SBNJoi8USVWWKczM8oYhKoULDBUzF9AScBUFTsAAAA" 7 | }, 8 | { 9 | "data": "H4sIAAAAAAAAADWO0QqCMBiFX2XsWsJSwrwLUW8sIYUuQmLpnxvpJttMQnz3Ztrlxzm" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /internal/component/loki/source/aws_firehose/internal/testdata/cw_logs_with_only_control_messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "requestId": "86208cf6-2bcc-47e6-9010-02ca9f44a025", 3 | "timestamp": 1684424042901, 4 | "records": [ 5 | { 6 | "data": "H4sIAAAAAAAAADWO0QqCMBiFX2XsWsJSwrwLUW8sIYUuQmLpnxvpJttMQnz3Ztrlxzmc8424BaVIDfmnA+zjID3nlzS5n8IsO8YhtrAYOMg5aURfDUSXNBG1MkEj6liKvjPZQpmWQNoFVf9QpWSdZoJHrNEgFfZvxa8XvoHrGUfMqqWumdHQpDVj273nujvn4Nm251h/vVngmqBVD616PgoolC/Ga0SBNJoi8USVWWKczM8oYhKoULDBUzF9AScBUFTsAAAA" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /internal/component/loki/source/aws_firehose/internal/testdata/direct_put.json: -------------------------------------------------------------------------------- 1 | { 2 | "requestId": "a1af4300-6c09-4916-ba8f-12f336176246", 3 | "timestamp": 1684422829730, 4 | "records": [ 5 | { 6 | "data": "eyJDSEFOR0UiOi0wLjIzLCJQUklDRSI6NC44LCJUSUNLRVJfU1lNQk9MIjoiTkdDIiwiU0VDVE9SIjoiSEVBTFRIQ0FSRSJ9" 7 | }, 8 | { 9 | "data": "eyJDSEFOR0UiOjYuNzYsIlBSSUNFIjo4Mi41NiwiVElDS0VSX1NZTUJPTCI6IlNMVyIsIlNFQ1RPUiI6IkVORVJHWSJ9" 10 | }, 11 | { 12 | "data": "eyJDSEFOR0UiOi01LjkyLCJQUklDRSI6MTk5LjA4LCJUSUNLRVJfU1lNQk9MIjoiSEpWIiwiU0VDVE9SIjoiRU5FUkdZIn0=" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /internal/component/loki/source/aws_firehose/internal/testdata/direct_put_with_non_json_message.json: -------------------------------------------------------------------------------- 1 | { 2 | "requestId": "aa9febd3-d9d0-45a2-9032-294078d926d5", 3 | "timestamp": 1684770308881, 4 | "records": [ 5 | { 6 | "data": "aG9sYSBlc3RvIGVzIHVuYSBwcnVlYmE=" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /internal/component/loki/source/azure_event_hubs/internal/parser/testdata/custom_payload_json.json: -------------------------------------------------------------------------------- 1 | {"json":"I am valid json"} -------------------------------------------------------------------------------- /internal/component/loki/source/azure_event_hubs/internal/parser/testdata/custom_payload_json_with_records_array.json: -------------------------------------------------------------------------------- 1 | {"records": [ 2 | "I am valid json", 3 | "Me too", 4 | { 5 | "MyKey": "MyValue" 6 | } 7 | ]} -------------------------------------------------------------------------------- /internal/component/loki/source/azure_event_hubs/internal/parser/testdata/custom_payload_json_with_records_string.json: -------------------------------------------------------------------------------- 1 | {"records":"I am valid json"} -------------------------------------------------------------------------------- /internal/component/loki/source/azure_event_hubs/internal/parser/testdata/custom_payload_text.txt: -------------------------------------------------------------------------------- 1 | Message with quotes " ` -------------------------------------------------------------------------------- /internal/component/loki/source/azure_event_hubs/internal/parser/testdata/message_with_invalid_time.json: -------------------------------------------------------------------------------- 1 | { 2 | "records": [ 3 | { 4 | "time": "SOME-ERROR-HERE-T08:44:02.8921579Z", 5 | "category": "WorkflowRuntime" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /internal/component/loki/source/docker/internal/dockertarget/testdata/flog.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/docker/internal/dockertarget/testdata/flog.log -------------------------------------------------------------------------------- /internal/component/loki/source/docker/internal/dockertarget/testdata/flog_after_restart.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/docker/internal/dockertarget/testdata/flog_after_restart.log -------------------------------------------------------------------------------- /internal/component/loki/source/file/reader.go: -------------------------------------------------------------------------------- 1 | package file 2 | 3 | // This code is copied from loki/promtail@a8d5815510bd959a6dd8c176a5d9fd9bbfc8f8b5. 4 | // This code accommodates the tailer and decompressor implementations as readers. 5 | 6 | // reader contains the set of methods the loki.source.file component uses. 7 | type reader interface { 8 | Stop() 9 | IsRunning() bool 10 | Path() string 11 | MarkPositionAndSize() error 12 | } 13 | -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/long-access.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/long-access.gz -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/long-access.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/long-access.tar.gz -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/onelinelog.log: -------------------------------------------------------------------------------- 1 | 5.202.214.160 - - [26/Jan/2019:19:45:25 +0330] "GET / HTTP/1.1" 200 30975 "https://www.zanbil.ir/" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0" "-" -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/onelinelog.log.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/onelinelog.log.bz2 -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/onelinelog.log.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/onelinelog.log.gz -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/onelinelog.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/onelinelog.tar.gz -------------------------------------------------------------------------------- /internal/component/loki/source/file/testdata/short-access.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/loki/source/file/testdata/short-access.tar.gz -------------------------------------------------------------------------------- /internal/component/loki/source/gcplog/internal/gcplogtarget/types.go: -------------------------------------------------------------------------------- 1 | package gcplogtarget 2 | 3 | // Target is a common interface implemented by both GCPLog targets. 4 | type Target interface { 5 | Details() map[string]string 6 | Stop() error 7 | } 8 | -------------------------------------------------------------------------------- /internal/component/loki/source/podlogs/internal/apis/monitoring/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=monitoring.grafana.com 3 | 4 | //go:generate controller-gen object paths=. 5 | //go:generate controller-gen crd:crdVersions=v1 paths=. output:crd:dir=../../../../../../../../operations/helm/charts/grafana-agent/crds 6 | 7 | package v1alpha2 8 | -------------------------------------------------------------------------------- /internal/component/otelcol/config_debug_metrics.go: -------------------------------------------------------------------------------- 1 | package otelcol 2 | 3 | // DebugMetricsArguments configures internal metrics of the components 4 | type DebugMetricsArguments struct { 5 | DisableHighCardinalityMetrics bool `river:"disable_high_cardinality_metrics,attr,optional"` 6 | } 7 | 8 | // SetToDefault implements river.Defaulter. 9 | func (args *DebugMetricsArguments) SetToDefault() { 10 | *args = DebugMetricsArguments{ 11 | DisableHighCardinalityMetrics: true, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /internal/component/otelcol/config_timeout.go: -------------------------------------------------------------------------------- 1 | package otelcol 2 | 3 | import "time" 4 | 5 | // DefaultTimeout holds the default timeout used for components which can time 6 | // out from requests. 7 | var DefaultTimeout = 5 * time.Second 8 | -------------------------------------------------------------------------------- /internal/component/otelcol/connector/host_info/factory_test.go: -------------------------------------------------------------------------------- 1 | package host_info 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "go.opentelemetry.io/collector/component/componenttest" 8 | "gotest.tools/assert" 9 | ) 10 | 11 | func TestCreateDefaultConfig(t *testing.T) { 12 | factory := NewFactory() 13 | cfg := factory.CreateDefaultConfig() 14 | 15 | assert.DeepEqual(t, &Config{ 16 | HostIdentifiers: []string{"host.id"}, 17 | MetricsFlushInterval: 60 * time.Second, 18 | }, cfg) 19 | 20 | assert.NilError(t, componenttest.CheckConfigStruct(cfg)) 21 | } 22 | -------------------------------------------------------------------------------- /internal/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/README.md: -------------------------------------------------------------------------------- 1 | # jaegerremotesampling 2 | 3 | This package is a fork of 4 | https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/jaegerremotesampling 5 | which supports string-based sampling sources. 6 | -------------------------------------------------------------------------------- /internal/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/testdata/config.yaml: -------------------------------------------------------------------------------- 1 | jaegerremotesampling: 2 | source: 3 | remote: 4 | endpoint: jaeger-collector:14250 5 | jaegerremotesampling/1: 6 | source: 7 | reload_interval: 1s 8 | file: /etc/otelcol/sampling_strategies.json -------------------------------------------------------------------------------- /internal/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/testdata/strategy.json: -------------------------------------------------------------------------------- 1 | {"strategyType":"PROBABILISTIC"} -------------------------------------------------------------------------------- /internal/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/README.md: -------------------------------------------------------------------------------- 1 | # strategy_store 2 | 3 | This package is a fork of 4 | https://github.com/jaegertracing/jaeger/blob/v1.38.1/plugin/sampling/strategystore/static/strategy_store.go 5 | to support a string-based strategy store. 6 | -------------------------------------------------------------------------------- /internal/component/otelcol/processor/resourcedetection/internal/resource_attribute_config/resource_attribute_config.go: -------------------------------------------------------------------------------- 1 | package resource_attribute_config 2 | 3 | // Configures whether a resource attribute should be enabled or not. 4 | type ResourceAttributeConfig struct { 5 | Enabled bool `river:"enabled,attr"` 6 | } 7 | 8 | func (r ResourceAttributeConfig) Convert() map[string]interface{} { 9 | return map[string]interface{}{ 10 | "enabled": r.Enabled, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /internal/component/prometheus/operator/types_test.go: -------------------------------------------------------------------------------- 1 | package operator 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/river" 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | func TestRiverUnmarshal(t *testing.T) { 11 | var exampleRiverConfig = ` 12 | forward_to = [] 13 | namespaces = ["my-app"] 14 | selector { 15 | match_expression { 16 | key = "team" 17 | operator = "In" 18 | values = ["ops"] 19 | } 20 | match_labels = { 21 | team = "ops", 22 | } 23 | } 24 | ` 25 | 26 | var args Arguments 27 | err := river.Unmarshal([]byte(exampleRiverConfig), &args) 28 | require.NoError(t, err) 29 | } 30 | -------------------------------------------------------------------------------- /internal/component/pyroscope/java/asprof/asprof_linux_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build linux && amd64 2 | 3 | package asprof 4 | 5 | import ( 6 | _ "embed" 7 | ) 8 | 9 | //go:embed async-profiler-3.0-linux-x64.tar.gz 10 | var embededArchiveData []byte 11 | 12 | // asprof 13 | // glibc / libasyncProfiler.so 14 | // musl / libasyncProfiler.so 15 | 16 | var embededArchiveVersion = 300 17 | 18 | var EmbeddedArchive = Archive{data: embededArchiveData, version: embededArchiveVersion} 19 | -------------------------------------------------------------------------------- /internal/component/pyroscope/java/asprof/asprof_linux_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build linux && arm64 2 | 3 | package asprof 4 | 5 | import ( 6 | _ "embed" 7 | ) 8 | 9 | //go:embed async-profiler-3.0-linux-arm64.tar.gz 10 | var embededArchiveData []byte 11 | 12 | // asprof 13 | // glibc / libasyncProfiler.so 14 | // musl / libasyncProfiler.so 15 | 16 | var embededArchiveVersion = 300 17 | 18 | var EmbeddedArchive = Archive{data: embededArchiveData, version: embededArchiveVersion} 19 | -------------------------------------------------------------------------------- /internal/component/pyroscope/java/asprof/async-profiler-3.0-linux-arm64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/java/asprof/async-profiler-3.0-linux-arm64.tar.gz -------------------------------------------------------------------------------- /internal/component/pyroscope/java/asprof/async-profiler-3.0-linux-x64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/java/asprof/async-profiler-3.0-linux-x64.tar.gz -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/big-heap.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/big-heap.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/block.after.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/block.after.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/block.before.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/block.before.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/0f7209b356e13da8388f52dba89dfc4669e45654f23e8446fd5292fa1bb62cf3: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("8\x0080") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/6281ce98ad6bb944a23bb21f7597f91ae767be28cf9ebfaaa40e3d1454c12be3: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("\x12\n\xed\xef00000\b00") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/74a0704b407ac210d9de0d409cba6bd17597ba4e67e73fcf7bdffa31438ac64f: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("j\x1a00000000\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9\xc9000000000") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/76b05762f4f652d9c3b8aeaf7c0301e0be9045945811b270c33d4f0a2760eea2: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("\b0\b0\b0\b0\b0\x100\x100") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/aafd8cbacf61de60d2748f9d49fb622c32f7f885b5a651355a7350b2fbd4bad8: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("\x1200\"00000000\x12\x120000000\xf0\xc90\x06\x06\x06\x06\x06\x060\x90\x9e000000000000000000000") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/d4fd55d49c674b8963a355107bfd2fb13eb81289831066a0b9f16190c2592c8a: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("h0") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/eec2ef2090730346d172334a24dee416e17c1511472fb808f3f9b4d68a46e3e5: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("j\x01\xc2") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/fuzz/FuzzDelta/f06e6fad1d62671c4b62ece89e9d85da6bd270176ce44ec809c52607cdc58680: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("8\xa0\x8b0") 3 | -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.after.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.after.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.before.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.before.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/heap.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.2.after.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.2.after.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.2.before.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.2.before.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.3.after.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.3.after.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.3.before.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.3.before.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.after.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.after.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.before.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/fastdelta/testdata/stress-failure.before.pprof -------------------------------------------------------------------------------- /internal/component/pyroscope/scrape/internal/pproflite/testdata/heap.pprof: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/component/pyroscope/scrape/internal/pproflite/testdata/heap.pprof -------------------------------------------------------------------------------- /internal/converter/internal/common/custom_tokenizer.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/grafana/river/token" 5 | "github.com/grafana/river/token/builder" 6 | ) 7 | 8 | type CustomTokenizer struct { 9 | Expr string 10 | } 11 | 12 | var _ builder.Tokenizer = CustomTokenizer{} 13 | 14 | func (f CustomTokenizer) RiverTokenize() []builder.Token { 15 | return []builder.Token{{ 16 | Tok: token.STRING, 17 | Lit: f.Expr, 18 | }} 19 | } 20 | -------------------------------------------------------------------------------- /internal/converter/internal/common/river_utils_test.go: -------------------------------------------------------------------------------- 1 | package common_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/internal/converter/internal/common" 7 | "github.com/grafana/river" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestDefaultValue(t *testing.T) { 12 | var explicitDefault defaultingType 13 | explicitDefault.SetToDefault() 14 | 15 | require.Equal(t, explicitDefault, common.DefaultValue[defaultingType]()) 16 | } 17 | 18 | type defaultingType struct { 19 | Number int 20 | } 21 | 22 | var _ river.Defaulter = (*defaultingType)(nil) 23 | 24 | func (dt *defaultingType) SetToDefault() { 25 | dt.Number = 42 26 | } 27 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/basicauth.river: -------------------------------------------------------------------------------- 1 | otelcol.auth.basic "default" { 2 | username = "username" 3 | password = "password" 4 | } 5 | 6 | otelcol.auth.basic "default_client" { 7 | username = "username2" 8 | password = "password2" 9 | } 10 | 11 | otelcol.receiver.otlp "default" { 12 | grpc { } 13 | 14 | http { } 15 | 16 | output { 17 | metrics = [otelcol.exporter.otlp.default.input] 18 | logs = [otelcol.exporter.otlp.default.input] 19 | traces = [otelcol.exporter.otlp.default.input] 20 | } 21 | } 22 | 23 | otelcol.exporter.otlp "default" { 24 | client { 25 | endpoint = "database:4317" 26 | auth = otelcol.auth.basic.default.handler 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/batch.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.processor.batch.default.input] 8 | logs = [otelcol.processor.batch.default.input] 9 | traces = [otelcol.processor.batch.default.input] 10 | } 11 | } 12 | 13 | otelcol.processor.batch "default" { 14 | output { 15 | metrics = [otelcol.exporter.otlp.default.input] 16 | logs = [otelcol.exporter.otlp.default.input] 17 | traces = [otelcol.exporter.otlp.default.input] 18 | } 19 | } 20 | 21 | otelcol.exporter.otlp "default" { 22 | client { 23 | endpoint = "database:4317" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/batch.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | processors: 8 | batch: 9 | 10 | exporters: 11 | otlp: 12 | endpoint: database:4317 13 | 14 | service: 15 | pipelines: 16 | metrics: 17 | receivers: [otlp] 18 | processors: [batch] 19 | exporters: [otlp] 20 | logs: 21 | receivers: [otlp] 22 | processors: [batch] 23 | exporters: [otlp] 24 | traces: 25 | receivers: [otlp] 26 | processors: [batch] 27 | exporters: [otlp] 28 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/inconsistent_processor.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.exporter.otlp.default.input] 8 | logs = [otelcol.processor.batch.default.input] 9 | traces = [otelcol.exporter.otlp.default.input] 10 | } 11 | } 12 | 13 | otelcol.processor.batch "default" { 14 | output { 15 | metrics = [] 16 | logs = [otelcol.exporter.otlp.default.input] 17 | traces = [] 18 | } 19 | } 20 | 21 | otelcol.exporter.otlp "default" { 22 | client { 23 | endpoint = "database:4317" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/inconsistent_processor.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | processors: 8 | batch: 9 | 10 | exporters: 11 | otlp: 12 | endpoint: database:4317 13 | 14 | service: 15 | pipelines: 16 | metrics: 17 | receivers: [otlp] 18 | processors: [] 19 | exporters: [otlp] 20 | logs: 21 | receivers: [otlp] 22 | processors: [batch] 23 | exporters: [otlp] 24 | traces: 25 | receivers: [otlp] 26 | processors: [] 27 | exporters: [otlp] 28 | 29 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/jaeger.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.jaeger "default" { 2 | protocols { 3 | grpc { } 4 | 5 | thrift_http { } 6 | 7 | thrift_binary { 8 | max_packet_size = "63KiB488B" 9 | } 10 | 11 | thrift_compact { 12 | max_packet_size = "63KiB488B" 13 | } 14 | } 15 | 16 | output { 17 | traces = [otelcol.exporter.otlp.default.input] 18 | } 19 | } 20 | 21 | otelcol.exporter.otlp "default" { 22 | client { 23 | endpoint = "database:4317" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/jaeger.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | jaeger: 3 | protocols: 4 | grpc: 5 | thrift_binary: 6 | thrift_compact: 7 | thrift_http: 8 | 9 | exporters: 10 | otlp: 11 | endpoint: database:4317 12 | 13 | service: 14 | pipelines: 15 | traces: 16 | receivers: [jaeger] 17 | processors: [] 18 | exporters: [otlp] 19 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/k8sattributes.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | processors: 12 | k8sattributes: 13 | 14 | service: 15 | pipelines: 16 | metrics: 17 | receivers: [otlp] 18 | processors: [k8sattributes] 19 | exporters: [otlp] 20 | logs: 21 | receivers: [otlp] 22 | processors: [k8sattributes] 23 | exporters: [otlp] 24 | traces: 25 | receivers: [otlp] 26 | processors: [k8sattributes] 27 | exporters: [otlp] 28 | 29 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/loadbalancing.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | output { 5 | metrics = [otelcol.exporter.loadbalancing.default.input] 6 | logs = [otelcol.exporter.loadbalancing.default.input] 7 | traces = [otelcol.exporter.loadbalancing.default.input] 8 | } 9 | } 10 | 11 | otelcol.exporter.loadbalancing "default" { 12 | protocol { 13 | otlp { 14 | client { } 15 | } 16 | } 17 | 18 | resolver { 19 | static { 20 | hostnames = ["backend-1:4317", "backend-2:4317", "backend-3:4317"] 21 | } 22 | } 23 | routing_key = "service" 24 | } 25 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/logging.diags: -------------------------------------------------------------------------------- 1 | (Error) The converter does not support converting the provided otelcol logging exporter loglevel config: use verbosity instead since loglevel is deprecated -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/memorylimiter.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | processors: 12 | memory_limiter: 13 | limit_percentage: 90 14 | check_interval: 1s 15 | 16 | 17 | service: 18 | pipelines: 19 | metrics: 20 | receivers: [otlp] 21 | processors: [memory_limiter] 22 | exporters: [otlp] 23 | logs: 24 | receivers: [otlp] 25 | processors: [memory_limiter] 26 | exporters: [otlp] 27 | traces: 28 | receivers: [otlp] 29 | processors: [memory_limiter] 30 | exporters: [otlp] 31 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/opencensus.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.opencensus "default" { 2 | output { 3 | metrics = [otelcol.exporter.otlp.default.input] 4 | traces = [otelcol.exporter.otlp.default.input] 5 | } 6 | } 7 | 8 | otelcol.exporter.otlp "default" { 9 | client { 10 | endpoint = "database:4317" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/opencensus.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | opencensus: 3 | 4 | exporters: 5 | otlp: 6 | endpoint: database:4317 7 | 8 | service: 9 | pipelines: 10 | metrics: 11 | receivers: [opencensus] 12 | processors: [] 13 | exporters: [otlp] 14 | traces: 15 | receivers: [opencensus] 16 | processors: [] 17 | exporters: [otlp] 18 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/corrupt_config.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to get otelcol config: cannot unmarshal the configuration: 1 error(s) decoding:\n\n* '' has invalid keys: bad-key 2 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/corrupt_config.yaml: -------------------------------------------------------------------------------- 1 | bad-key: 2 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/duplicate_receivers.diags: -------------------------------------------------------------------------------- 1 | (Critical) the configuration is unsupported because the receiver "otlp" is used across multiple pipelines with distinct names 2 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/duplicate_receivers.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | # A receiver may not appear in two different groups. 12 | service: 13 | pipelines: 14 | metrics: # Group 15 | receivers: [otlp] 16 | processors: [] 17 | exporters: [otlp] 18 | traces/2: # Group 2 19 | receivers: [otlp] 20 | processors: [] 21 | exporters: [otlp] 22 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/invalid_config.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to validate config: no receiver configuration specified in config 2 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otelcol_errors/invalid_config.yaml: -------------------------------------------------------------------------------- 1 | # A config is invalid if it doesn't at least have one receiver and 2 | # exporter in every pipeline. 3 | service: 4 | pipelines: 5 | metrics: 6 | receivers: [] 7 | processors: [] 8 | exporters: [] 9 | 10 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otlp.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.exporter.otlp.default.input] 8 | logs = [otelcol.exporter.otlp.default.input] 9 | traces = [otelcol.exporter.otlp.default.input] 10 | } 11 | } 12 | 13 | otelcol.exporter.otlp "default" { 14 | client { 15 | endpoint = "database:4317" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otlp.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | service: 12 | pipelines: 13 | metrics: 14 | receivers: [otlp] 15 | processors: [] 16 | exporters: [otlp] 17 | logs: 18 | receivers: [otlp] 19 | processors: [] 20 | exporters: [otlp] 21 | traces: 22 | receivers: [otlp] 23 | processors: [] 24 | exporters: [otlp] 25 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otlphttp.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.exporter.otlphttp.default.input] 8 | logs = [otelcol.exporter.otlphttp.default.input] 9 | traces = [otelcol.exporter.otlphttp.default.input] 10 | } 11 | } 12 | 13 | otelcol.exporter.otlphttp "default" { 14 | client { 15 | endpoint = "database:4318" 16 | http2_ping_timeout = "0s" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/otlphttp.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlphttp: 9 | endpoint: database:4318 10 | 11 | service: 12 | pipelines: 13 | metrics: 14 | receivers: [otlp] 15 | processors: [] 16 | exporters: [otlphttp] 17 | logs: 18 | receivers: [otlp] 19 | processors: [] 20 | exporters: [otlphttp] 21 | traces: 22 | receivers: [otlp] 23 | processors: [] 24 | exporters: [otlphttp] 25 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/probabilistic_sampler.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.exporter.otlp.default.input] 8 | logs = [otelcol.processor.probabilistic_sampler.default.input] 9 | traces = [otelcol.processor.probabilistic_sampler.default.input] 10 | } 11 | } 12 | 13 | otelcol.processor.probabilistic_sampler "default" { 14 | output { 15 | logs = [otelcol.exporter.otlp.default.input] 16 | traces = [otelcol.exporter.otlp.default.input] 17 | } 18 | } 19 | 20 | otelcol.exporter.otlp "default" { 21 | client { 22 | endpoint = "database:4317" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/probabilistic_sampler.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | processors: 12 | probabilistic_sampler: 13 | 14 | service: 15 | pipelines: 16 | metrics: 17 | receivers: [otlp] 18 | processors: [] 19 | exporters: [otlp] 20 | logs: 21 | receivers: [otlp] 22 | processors: [probabilistic_sampler] 23 | exporters: [otlp] 24 | traces: 25 | receivers: [otlp] 26 | processors: [probabilistic_sampler] 27 | exporters: [otlp] 28 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/span.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [otelcol.exporter.otlp.default.input] 8 | logs = [otelcol.exporter.otlp.default.input] 9 | traces = [otelcol.processor.span.default.input] 10 | } 11 | } 12 | 13 | otelcol.processor.span "default" { 14 | output { 15 | traces = [otelcol.exporter.otlp.default.input] 16 | } 17 | } 18 | 19 | otelcol.exporter.otlp "default" { 20 | client { 21 | endpoint = "database:4317" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/span.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | processors: 12 | span: 13 | 14 | service: 15 | pipelines: 16 | metrics: 17 | receivers: [otlp] 18 | processors: [] 19 | exporters: [otlp] 20 | logs: 21 | receivers: [otlp] 22 | processors: [] 23 | exporters: [otlp] 24 | traces: 25 | receivers: [otlp] 26 | processors: [span] 27 | exporters: [otlp] 28 | 29 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/spanmetrics.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.otlp "default" { 2 | grpc { } 3 | 4 | http { } 5 | 6 | output { 7 | metrics = [] 8 | logs = [otelcol.exporter.otlp.default.input] 9 | traces = [otelcol.connector.spanmetrics.default.input] 10 | } 11 | } 12 | 13 | otelcol.exporter.otlp "default" { 14 | client { 15 | endpoint = "database:4317" 16 | } 17 | } 18 | 19 | otelcol.connector.spanmetrics "default" { 20 | histogram { 21 | explicit { } 22 | } 23 | 24 | output { 25 | metrics = [otelcol.exporter.otlp.default.input] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/spanmetrics.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | http: 6 | 7 | exporters: 8 | otlp: 9 | endpoint: database:4317 10 | 11 | processors: 12 | batch: 13 | 14 | connectors: 15 | spanmetrics: 16 | 17 | service: 18 | pipelines: 19 | traces: 20 | receivers: [otlp] 21 | processors: [] 22 | exporters: [spanmetrics] 23 | metrics: 24 | receivers: [spanmetrics] 25 | processors: [] 26 | exporters: [otlp] 27 | logs: 28 | receivers: [otlp] 29 | processors: [] 30 | exporters: [otlp] 31 | 32 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/vcenterreceiver.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.vcenter "default" { 2 | endpoint = "http://localhost:15672" 3 | username = "otelu" 4 | password = "abc" 5 | 6 | metrics { 7 | vcenter.host.cpu.utilization { 8 | enabled = false 9 | } 10 | } 11 | 12 | resource_attributes { 13 | vcenter.cluster.name { 14 | enabled = false 15 | } 16 | } 17 | 18 | output { 19 | metrics = [] 20 | traces = [otelcol.exporter.otlp.default.input] 21 | } 22 | } 23 | 24 | otelcol.exporter.otlp "default" { 25 | client { 26 | endpoint = "database:4317" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/vcenterreceiver.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | vcenter: 3 | endpoint: http://localhost:15672 4 | username: otelu 5 | password: "abc" 6 | collection_interval: 1m 7 | initial_delay: 1s 8 | metrics: 9 | vcenter.host.cpu.utilization: 10 | enabled: false 11 | resource_attributes: 12 | vcenter.cluster.name: 13 | enabled: false 14 | 15 | exporters: 16 | otlp: 17 | endpoint: database:4317 18 | 19 | service: 20 | pipelines: 21 | traces: 22 | receivers: [vcenter] 23 | processors: [] 24 | exporters: [otlp] 25 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/zipkin.river: -------------------------------------------------------------------------------- 1 | otelcol.receiver.zipkin "default" { 2 | output { 3 | traces = [otelcol.exporter.otlp.default.input] 4 | } 5 | } 6 | 7 | otelcol.exporter.otlp "default" { 8 | client { 9 | endpoint = "database:4317" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /internal/converter/internal/otelcolconvert/testdata/zipkin.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | zipkin: 3 | 4 | exporters: 5 | otlp: 6 | endpoint: database:4317 7 | 8 | service: 9 | pipelines: 10 | traces: 11 | receivers: [zipkin] 12 | processors: [] 13 | exporters: [otlp] 14 | -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/prometheusconvert_test.go: -------------------------------------------------------------------------------- 1 | package prometheusconvert_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/internal/converter/internal/prometheusconvert" 7 | "github.com/grafana/agent/internal/converter/internal/test_common" 8 | _ "github.com/grafana/agent/static/metrics/instance" 9 | ) 10 | 11 | func TestConvert(t *testing.T) { 12 | test_common.TestDirectory(t, "testdata", ".yaml", true, []string{}, prometheusconvert.Convert) 13 | } 14 | -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/azure.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | azure_sd_configs: 6 | - subscription_id: "subscription" 7 | tenant_id: "tenant" 8 | client_id: "client" 9 | client_secret: "secret" 10 | - job_name: "prometheus2" 11 | azure_sd_configs: 12 | - subscription_id: "subscription" 13 | tenant_id: "tenant" 14 | client_id: "client" 15 | client_secret: "secret" 16 | proxy_url: "proxy" 17 | follow_redirects: false 18 | 19 | remote_write: 20 | - name: "remote1" 21 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/bad_config.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to parse Prometheus config: yaml: unmarshal errors:\n line 7: field not_a_thing not found in type config.plain -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/broken_yaml.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to parse Prometheus config: yaml: line 18: did not find expected key -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/consul.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | consul_sd_configs: 6 | - server: 'localhost:8500' 7 | services: ['myapp'] 8 | - job_name: "prometheus2" 9 | consul_sd_configs: 10 | - server: 'localhost:8500' 11 | services: ['otherapp'] 12 | 13 | remote_write: 14 | - name: "remote1" 15 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/digitalocean.diags: -------------------------------------------------------------------------------- 1 | (Error) The converter does not support converting the provided digitalocean_sd_configs basic_auth config. -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/digitalocean.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | digitalocean_sd_configs: 6 | - proxy_from_environment: true 7 | proxy_connect_header: 8 | Authorization: ["something", "something else"] 9 | Host: ["localhost"] 10 | basic_auth: 11 | username: 'user' 12 | password: 'pass' 13 | - job_name: "prometheus2" 14 | digitalocean_sd_configs: 15 | - proxy_from_environment: true 16 | 17 | remote_write: 18 | - name: "remote1" 19 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/dns.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | dns_sd_configs: 6 | - names: 7 | - 'myapp.service.consul' 8 | type: 'SRV' 9 | port: 8080 10 | - job_name: "prometheus2" 11 | dns_sd_configs: 12 | - names: 13 | - 'myapp.service.consul' 14 | type: 'AAAA' 15 | port: 8080 16 | 17 | remote_write: 18 | - name: "remote1" 19 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/docker.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | docker_sd_configs: 6 | - host: "unix:///var/run/docker.sock" 7 | - job_name: "prometheus2" 8 | docker_sd_configs: 9 | - host: "unix:///var/run/docker.sock" 10 | 11 | remote_write: 12 | - name: "remote1" 13 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/ec2.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | ec2_sd_configs: 6 | - region: 'us-east-1' 7 | access_key: 'YOUR_ACCESS_KEY' 8 | secret_key: 'YOUR_SECRET_KEY' 9 | port: 8080 10 | bearer_token_file: "/tmp/token.file" 11 | - job_name: "prometheus2" 12 | ec2_sd_configs: 13 | - region: 'us-east-1' 14 | access_key: 'YOUR_ACCESS_KEY' 15 | secret_key: 'YOUR_SECRET_KEY' 16 | port: 8080 17 | 18 | remote_write: 19 | - name: "remote1" 20 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/empty.river: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/converter/internal/prometheusconvert/testdata/empty.river -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/empty.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/converter/internal/prometheusconvert/testdata/empty.yaml -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/file.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | file_sd_configs: 6 | - refresh_interval: 5m 7 | files: 8 | - "/tmp/example_*.yaml" 9 | - "/tmp/example2_*.yaml" 10 | - job_name: "prometheus2" 11 | file_sd_configs: 12 | - refresh_interval: 1m 13 | files: 14 | - "/tmp/example_*.yaml" 15 | - "/tmp/example2_*.yaml" 16 | 17 | remote_write: 18 | - name: "remote1" 19 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/gce.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | gce_sd_configs: 6 | - project: 'your-project-id' 7 | zone: 'us-central1-a' 8 | port: 8080 9 | - job_name: "prometheus2" 10 | gce_sd_configs: 11 | - project: 'your-project-id' 12 | zone: 'us-central1-a' 13 | port: 8080 14 | 15 | remote_write: 16 | - name: "remote1" 17 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/ionos.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | ionos_sd_configs: 6 | - refresh_interval: 5m 7 | datacenter_id: "datacenter_id" 8 | port: 81 9 | - job_name: "prometheus2" 10 | ionos_sd_configs: 11 | - refresh_interval: 1m 12 | datacenter_id: "datacenter_id2" 13 | basic_auth: 14 | username: username 15 | password: password 16 | 17 | remote_write: 18 | - name: "remote1" 19 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/kubernetes.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | kubernetes_sd_configs: 6 | - role: endpoints 7 | - job_name: "prometheus2" 8 | kubernetes_sd_configs: 9 | - role: endpoints 10 | 11 | remote_write: 12 | - name: "remote1" 13 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/kuma.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | kuma_sd_configs: 6 | - server: "http://kuma-control-plane.kuma-system.svc:5677" 7 | refresh_interval: "1m" 8 | - job_name: "prometheus2" 9 | kuma_sd_configs: 10 | - server: "http://kuma-control-plane.kuma-system.svc:5676" 11 | fetch_timeout: "10s" 12 | 13 | remote_write: 14 | - name: "remote1" 15 | url: "http://remote-write-url1" 16 | 17 | -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/lightsail.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | lightsail_sd_configs: 6 | - region: 'us-east-1' 7 | access_key: 'YOUR_ACCESS_KEY' 8 | secret_key: 'YOUR_SECRET_KEY' 9 | port: 8080 10 | bearer_token_file: "/tmp/token.file" 11 | - job_name: "prometheus2" 12 | lightsail_sd_configs: 13 | - region: 'us-east-1' 14 | access_key: 'YOUR_ACCESS_KEY' 15 | secret_key: 'YOUR_SECRET_KEY' 16 | port: 8080 17 | 18 | remote_write: 19 | - name: "remote1" 20 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/linode.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | linode_sd_configs: 6 | - refresh_interval: "100s" 7 | port: 8080 8 | - job_name: "prometheus2" 9 | linode_sd_configs: 10 | - {} 11 | 12 | remote_write: 13 | - name: "remote1" 14 | url: "http://remote-write-url1" 15 | 16 | -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/marathon.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | marathon_sd_configs: 6 | - servers: ["serv1", "serv2"] 7 | refresh_interval: 20s 8 | auth_token: "auth_token" 9 | - job_name: "prometheus2" 10 | marathon_sd_configs: 11 | - servers: ["serv3"] 12 | basic_auth: 13 | username: "username" 14 | password: "password" 15 | 16 | remote_write: 17 | - name: "remote1" 18 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/nerve.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | nerve_sd_configs: 6 | - servers: ["1.2.3.4"] 7 | paths: ["/nerve/services/your_http_service/services", "/nerve/services/your_tcp_service/services"] 8 | timeout: "15s" 9 | - job_name: "prometheus2" 10 | nerve_sd_configs: 11 | - servers: ["127.0.0.1"] 12 | paths: ["/nerve/services/your_http_service/services"] 13 | 14 | remote_write: 15 | - name: "remote1" 16 | url: "http://remote-write-url1" 17 | 18 | -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/scrape.diags: -------------------------------------------------------------------------------- 1 | (Error) The converter does not support converting the provided scrape_configs track_timestamps_staleness config. -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/serverset.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | serverset_sd_configs: 4 | - servers: [ "zk1", "zk2", "zk3" ] 5 | paths: [ "/path/to/znode1", "/path/to/znode2" ] 6 | timeout: 30s 7 | - job_name: "prometheus2" 8 | serverset_sd_configs: 9 | - servers: [ "zk1" ] 10 | paths: [ "/path/to/znode1" ] 11 | 12 | remote_write: 13 | - name: "remote1" 14 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/prometheusconvert/testdata/triton.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: "prometheus1" 3 | static_configs: 4 | - targets: ["localhost:9090"] 5 | triton_sd_configs: 6 | - account: "TRITON_ACCOUNT" 7 | dns_suffix: "triton.example" 8 | endpoint: "0.0.0.0:8080" 9 | - job_name: "prometheus2" 10 | triton_sd_configs: 11 | - account: "TRITON_ACCOUNT" 12 | dns_suffix: "triton.example2" 13 | endpoint: "0.0.0.0:8081" 14 | 15 | remote_write: 16 | - name: "remote1" 17 | url: "http://remote-write-url1" -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/internal/build/global_context.go: -------------------------------------------------------------------------------- 1 | package build 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/grafana/agent/internal/component/common/loki" 7 | ) 8 | 9 | type GlobalContext struct { 10 | WriteReceivers []loki.LogsReceiver 11 | TargetSyncPeriod time.Duration 12 | LabelPrefix string 13 | } 14 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/promtailconvert_test.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | 3 | package promtailconvert_test 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/grafana/agent/internal/converter/internal/promtailconvert" 9 | "github.com/grafana/agent/internal/converter/internal/test_common" 10 | _ "github.com/grafana/agent/static/metrics/instance" // Imported to override default values via the init function. 11 | ) 12 | 13 | func TestConvert(t *testing.T) { 14 | test_common.TestDirectory(t, "testdata", ".yaml", true, []string{}, promtailconvert.Convert) 15 | } 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/promtailconvert_windows_test.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package promtailconvert_test 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/grafana/agent/internal/converter/internal/promtailconvert" 9 | "github.com/grafana/agent/internal/converter/internal/test_common" 10 | _ "github.com/grafana/agent/static/metrics/instance" // Imported to override default values via the init function. 11 | ) 12 | 13 | func TestConvert(t *testing.T) { 14 | test_common.TestDirectory(t, "testdata", ".yaml", true, []string{}, promtailconvert.Convert) 15 | test_common.TestDirectory(t, "testdata_windows", ".yaml", true, []string{}, promtailconvert.Convert) 16 | } 17 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/azure.river: -------------------------------------------------------------------------------- 1 | discovery.azure "fun" { 2 | subscription_id = "subscription" 3 | 4 | oauth { 5 | client_id = "client" 6 | tenant_id = "tenant" 7 | client_secret = "secret" 8 | } 9 | 10 | managed_identity { 11 | client_id = "client" 12 | } 13 | } 14 | 15 | local.file_match "fun" { 16 | path_targets = discovery.azure.fun.targets 17 | } 18 | 19 | loki.source.file "fun" { 20 | targets = local.file_match.fun.targets 21 | forward_to = [] 22 | legacy_positions_file = "/var/log/positions.yaml" 23 | } 24 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/azure.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | azure_sd_configs: 4 | - subscription_id: "subscription" 5 | tenant_id: "tenant" 6 | client_id: "client" 7 | client_secret: "secret" 8 | tracing: {enabled: false} 9 | server: {register_instrumentation: false} 10 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/bad_config.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to parse Promtail config: yaml: unmarshal errors:\n line 11: field not_a_thing not found in type promtailconvert.Config -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/bad_config.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - external_labels: 3 | cluster: backyard-pine-treehouse-1 4 | url: http://localhost/loki/api/v1/push 5 | scrape_configs: 6 | - job_name: kubernetes-pods 7 | kubernetes_sd_configs: 8 | - role: pod 9 | pipeline_stages: 10 | - cri: {} 11 | not_a_thing: true 12 | server: 13 | profiling_enabled: true 14 | tracing: 15 | enabled: false 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/cloudflare_relabel.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | cloudflare: 6 | api_token: dont_look_at_me_please 7 | zone_id: area51 8 | labels: 9 | identity: unidentified 10 | object_type: flying 11 | workers: 42 12 | pull_range: 1h 13 | fields_type: all 14 | relabel_configs: 15 | - source_labels: 16 | - __trail__ 17 | target_label: __path__ 18 | tracing: {enabled: false} 19 | server: {register_instrumentation: false} 20 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/consulagent.diags: -------------------------------------------------------------------------------- 1 | (Warning) node_meta is not used by discovery.consulagent and will be ignored -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/digitalocean.river: -------------------------------------------------------------------------------- 1 | discovery.digitalocean "fun" { 2 | refresh_interval = "10m0s" 3 | port = 1234 4 | } 5 | 6 | local.file_match "fun" { 7 | path_targets = discovery.digitalocean.fun.targets 8 | } 9 | 10 | loki.source.file "fun" { 11 | targets = local.file_match.fun.targets 12 | forward_to = [] 13 | legacy_positions_file = "/var/log/positions.yaml" 14 | } 15 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/digitalocean.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | digitalocean_sd_configs: 4 | - refresh_interval: 10m 5 | port: 1234 6 | 7 | tracing: {enabled: false} 8 | server: {register_instrumentation: false} 9 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/dockerswarm.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | dockerswarm_sd_configs: 4 | - host : "http://localhost:8081" 5 | role: "nodes" 6 | port: 81 7 | filters: 8 | - name: "n1" 9 | values: 10 | - "v1" 11 | - "v2" 12 | - name: "n2" 13 | values: 14 | - "v3" 15 | refresh_interval: 5m 16 | basic_auth: 17 | username: "username" 18 | password: "password" 19 | - host : "http://localhost:8080" 20 | role: "services" 21 | tracing: {enabled: false} 22 | server: {register_instrumentation: false} 23 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/ec2.river: -------------------------------------------------------------------------------- 1 | discovery.ec2 "fun" { 2 | region = "us-east-1" 3 | access_key = "YOUR_ACCESS_KEY" 4 | secret_key = "YOUR_SECRET_KEY" 5 | port = 8080 6 | } 7 | 8 | local.file_match "fun" { 9 | path_targets = discovery.ec2.fun.targets 10 | } 11 | 12 | loki.source.file "fun" { 13 | targets = local.file_match.fun.targets 14 | forward_to = [] 15 | legacy_positions_file = "/var/log/positions.yaml" 16 | } 17 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/ec2.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | ec2_sd_configs: 4 | - region: 'us-east-1' 5 | access_key: 'YOUR_ACCESS_KEY' 6 | secret_key: 'YOUR_SECRET_KEY' 7 | port: 8080 8 | 9 | tracing: {enabled: false} 10 | server: {register_instrumentation: false} 11 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/file.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | file_sd_configs: 4 | - files: 5 | - /etc/prometheus/targets/*.json 6 | - /etc/prometheus/targets/*.yaml 7 | - /etc/prometheus/targets/*.json 8 | refresh_interval: 5m 9 | - files: 10 | - /etc/agent/targets/*.json 11 | - /etc/agent/targets/*.yaml 12 | - /etc/agent/targets/*.yml 13 | refresh_interval: 30m 14 | tracing: {enabled: false} 15 | server: {register_instrumentation: false} 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/gce.river: -------------------------------------------------------------------------------- 1 | discovery.gce "fun" { 2 | project = "your-project-id" 3 | zone = "us-central1-a" 4 | port = 8080 5 | } 6 | 7 | local.file_match "fun" { 8 | path_targets = discovery.gce.fun.targets 9 | } 10 | 11 | loki.source.file "fun" { 12 | targets = local.file_match.fun.targets 13 | forward_to = [] 14 | legacy_positions_file = "/var/log/positions.yaml" 15 | } 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/gce.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | gce_sd_configs: 4 | - project: 'your-project-id' 5 | zone: 'us-central1-a' 6 | port: 8080 7 | 8 | tracing: {enabled: false} 9 | server: {register_instrumentation: false} 10 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/gelf.river: -------------------------------------------------------------------------------- 1 | discovery.relabel "fun" { 2 | targets = [] 3 | 4 | rule { 5 | source_labels = ["__trail__"] 6 | target_label = "__path__" 7 | } 8 | } 9 | 10 | loki.source.gelf "fun" { 11 | listen_address = "localhost:12201" 12 | use_incoming_timestamp = true 13 | relabel_rules = discovery.relabel.fun.rules 14 | forward_to = [loki.write.default.receiver] 15 | } 16 | 17 | loki.write "default" { 18 | endpoint { 19 | url = "http://localhost/loki/api/v1/push" 20 | } 21 | external_labels = {} 22 | } 23 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/gelf.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | relabel_configs: 6 | - source_labels: 7 | - __trail__ 8 | target_label: __path__ 9 | gelf: 10 | listen_address: localhost:12201 11 | labels: 12 | job: fun 13 | quality: excellent 14 | use_incoming_timestamp: true 15 | tracing: {enabled: false} 16 | server: {register_instrumentation: false} 17 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/globalpositions.yaml: -------------------------------------------------------------------------------- 1 | positions: 2 | filename: /good/positions.yml 3 | scrape_configs: 4 | - job_name: fun 5 | file_sd_configs: 6 | - files: 7 | - /etc/prometheus/targets/*.json 8 | refresh_interval: 5m 9 | - files: 10 | - /etc/agent/targets/*.json 11 | refresh_interval: 30m 12 | - job_name: fun2 13 | file_sd_configs: 14 | - files: 15 | - /etc/prometheus/targets2/*.json 16 | refresh_interval: 5m 17 | - files: 18 | - /etc/agent/targets2/*.json 19 | refresh_interval: 30m 20 | tracing: {enabled: false} 21 | server: {register_instrumentation: false} -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/journal.river: -------------------------------------------------------------------------------- 1 | loki.source.journal "fun" { 2 | format_as_json = true 3 | max_age = "20h0m0s" 4 | relabel_rules = null 5 | forward_to = [loki.write.default.receiver] 6 | labels = { 7 | region = "chablis", 8 | variety = "chardonnay", 9 | } 10 | } 11 | 12 | loki.source.journal "example" { 13 | relabel_rules = null 14 | forward_to = [loki.write.default.receiver] 15 | labels = { 16 | best_friend = "bob", 17 | name = "alice", 18 | } 19 | } 20 | 21 | loki.write "default" { 22 | endpoint { 23 | url = "http://localhost/loki/api/v1/push" 24 | } 25 | external_labels = {} 26 | } 27 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/journal.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | journal: 6 | json: true 7 | max_age: 20h 8 | labels: 9 | variety: chardonnay 10 | region: chablis 11 | - job_name: example 12 | journal: 13 | labels: 14 | name: alice 15 | best_friend: bob 16 | tracing: {enabled: false} 17 | server: {register_instrumentation: false} 18 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/journal_relabel.river: -------------------------------------------------------------------------------- 1 | discovery.relabel "fun" { 2 | targets = [] 3 | 4 | rule { 5 | source_labels = ["__trail__"] 6 | target_label = "__path__" 7 | } 8 | } 9 | 10 | loki.source.journal "fun" { 11 | format_as_json = true 12 | max_age = "20h0m0s" 13 | relabel_rules = discovery.relabel.fun.rules 14 | forward_to = [loki.write.default.receiver] 15 | labels = { 16 | region = "chablis", 17 | variety = "chardonnay", 18 | } 19 | } 20 | 21 | loki.write "default" { 22 | endpoint { 23 | url = "http://localhost/loki/api/v1/push" 24 | } 25 | external_labels = {} 26 | } 27 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/journal_relabel.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | journal: 6 | json: true 7 | max_age: 20h 8 | labels: 9 | variety: chardonnay 10 | region: chablis 11 | relabel_configs: 12 | - source_labels: 13 | - __trail__ 14 | target_label: __path__ 15 | tracing: {enabled: false} 16 | server: {register_instrumentation: false} 17 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/loki_write.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | headers: 4 | fat: ball 5 | bird: house 6 | tenant_id: sparrow 7 | batchwait: 10s 8 | batchsize: 1024 9 | proxy_url: http://proxy.example.com 10 | backoff_config: 11 | min_period: 100ms 12 | max_period: 10s 13 | max_retries: 20 14 | drop_rate_limited_batches: true 15 | timeout: 30s 16 | - url: http://localhost/loki/api/v1/push 17 | drop_rate_limited_batches: false 18 | tracing: {enabled: false} 19 | server: {register_instrumentation: false} -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/marathon.river: -------------------------------------------------------------------------------- 1 | discovery.marathon "fun" { 2 | servers = ["serv1", "serv2"] 3 | refresh_interval = "5m0s" 4 | 5 | basic_auth { 6 | username = "username" 7 | password = "password" 8 | } 9 | } 10 | 11 | discovery.marathon "fun_2" { 12 | servers = ["serv3"] 13 | auth_token = "auth_token" 14 | } 15 | 16 | local.file_match "fun" { 17 | path_targets = concat( 18 | discovery.marathon.fun.targets, 19 | discovery.marathon.fun_2.targets, 20 | ) 21 | } 22 | 23 | loki.source.file "fun" { 24 | targets = local.file_match.fun.targets 25 | forward_to = [] 26 | legacy_positions_file = "/var/log/positions.yaml" 27 | } 28 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/marathon.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | marathon_sd_configs: 4 | - servers : ["serv1", "serv2"] 5 | refresh_interval: 5m 6 | basic_auth: 7 | username: "username" 8 | password: "password" 9 | - servers : ["serv3"] 10 | auth_token: "auth_token" 11 | tracing: {enabled: false} 12 | server: {register_instrumentation: false} 13 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/nerve.river: -------------------------------------------------------------------------------- 1 | discovery.nerve "fun" { 2 | servers = ["1.2.3.4"] 3 | paths = ["/nerve/services/your_http_service/services", "/nerve/services/your_tcp_service/services"] 4 | timeout = "15s" 5 | } 6 | 7 | local.file_match "fun" { 8 | path_targets = discovery.nerve.fun.targets 9 | } 10 | 11 | loki.source.file "fun" { 12 | targets = local.file_match.fun.targets 13 | forward_to = [] 14 | legacy_positions_file = "/var/log/positions.yaml" 15 | } 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/nerve.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | nerve_sd_configs: 4 | - servers: ["1.2.3.4"] 5 | paths: ["/nerve/services/your_http_service/services", "/nerve/services/your_tcp_service/services"] 6 | timeout: "15s" 7 | tracing: {enabled: false} 8 | server: {register_instrumentation: false} 9 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/pipeline_stages_cri_empty.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: example 5 | pipeline_stages: 6 | - cri: { } 7 | kubernetes_sd_configs: 8 | - role: pod 9 | kubeconfig_file: /home/toby/.kube/config 10 | 11 | tracing: { enabled: false } 12 | server: { register_instrumentation: false } -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/pipeline_stages_drop.diags: -------------------------------------------------------------------------------- 1 | (Error) invalid pipeline_stages.drop.longer_than field: strconv.UnmarshalText: parsing "1.21GIGAWATTS": invalid syntax 2 | (Error) invalid pipeline_stages.drop.older_than field: time: invalid duration "lightyear" 3 | (Error) invalid pipeline_stages.drop.source field type 'map[interface {}]interface {}': map[invalid:object] 4 | (Error) invalid pipeline_stages.drop.source[0] field type 'map[interface {}]interface {}': map[invalid:object] -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/pipeline_stages_structured_metadata.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: example 5 | pipeline_stages: 6 | - logfmt: 7 | mapping: 8 | app: 9 | - structured_metadata: 10 | app: app 11 | 12 | kubernetes_sd_configs: 13 | - role: pod 14 | kubeconfig_file: /home/toby/.kube/config 15 | 16 | tracing: { enabled: false } 17 | server: { register_instrumentation: false } -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/serverset.river: -------------------------------------------------------------------------------- 1 | discovery.serverset "fun" { 2 | servers = ["localhost:8500"] 3 | paths = ["/v1/catalog/services"] 4 | } 5 | 6 | local.file_match "fun" { 7 | path_targets = discovery.serverset.fun.targets 8 | } 9 | 10 | loki.source.file "fun" { 11 | targets = local.file_match.fun.targets 12 | forward_to = [] 13 | legacy_positions_file = "/var/log/positions.yaml" 14 | } 15 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/serverset.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | serverset_sd_configs: 4 | - servers: ['localhost:8500'] 5 | paths: ['/v1/catalog/services'] 6 | 7 | tracing: {enabled: false} 8 | server: {register_instrumentation: false} 9 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/source_pipeline_example.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | pipeline_stages: 6 | - json: 7 | expressions: 8 | face: smiley 9 | hand: thumbs-up 10 | source: video 11 | drop_malformed: true 12 | relabel_configs: 13 | - source_labels: 14 | - __trail__ 15 | target_label: __path__ 16 | journal: 17 | json: true 18 | max_age: 20h 19 | labels: 20 | variety: chardonnay 21 | region: chablis 22 | tracing: {enabled: false} 23 | server: {register_instrumentation: false} 24 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/triton.river: -------------------------------------------------------------------------------- 1 | discovery.triton "fun" { 2 | account = "TRITON_ACCOUNT" 3 | dns_suffix = "triton.example" 4 | endpoint = "0.0.0.0:8080" 5 | } 6 | 7 | local.file_match "fun" { 8 | path_targets = discovery.triton.fun.targets 9 | } 10 | 11 | loki.source.file "fun" { 12 | targets = local.file_match.fun.targets 13 | forward_to = [] 14 | legacy_positions_file = "/var/log/positions.yaml" 15 | } 16 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/triton.yaml: -------------------------------------------------------------------------------- 1 | scrape_configs: 2 | - job_name: fun 3 | triton_sd_configs: 4 | - account: "TRITON_ACCOUNT" 5 | dns_suffix: "triton.example" 6 | endpoint: "0.0.0.0:8080" 7 | tracing: {enabled: false} 8 | server: {register_instrumentation: false} 9 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata/unsupported.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | file_watch_config: 3 | min_poll_frequency: 1s 4 | max_poll_frequency: 5s 5 | clients: 6 | - url: http://localhost/loki/api/v1/push 7 | drop_rate_limited_batches: true 8 | positions: 9 | filename: /dev/urandom 10 | wal: 11 | enabled: true 12 | limits_config: 13 | readline_rate_enabled: true 14 | target_config: 15 | stdin: true 16 | server: 17 | profiling_enabled: true 18 | register_instrumentation: true 19 | log_level: error 20 | http_path_prefix: /cgi/bin 21 | health_check_target: false 22 | 23 | scrape_configs: 24 | - job_name: unsupported 25 | encoding: utf-16 26 | -------------------------------------------------------------------------------- /internal/converter/internal/promtailconvert/testdata_windows/windowsevents.yaml: -------------------------------------------------------------------------------- 1 | clients: 2 | - url: http://localhost/loki/api/v1/push 3 | scrape_configs: 4 | - job_name: fun 5 | windows_events: 6 | locale: 1033 7 | eventlog_name: "Application" 8 | xpath_query: Event/System[EventID=1000] 9 | use_incoming_timestamp: true 10 | bookmark_path: "C:/Users/username/Desktop/bookmark.txt" 11 | poll_interval: 10s 12 | exclude_event_data: true 13 | exclude_event_message: true 14 | exclude_user_data: true 15 | labels: 16 | job: windows 17 | host: localhost 18 | 19 | tracing: {enabled: false} 20 | server: {register_instrumentation: false} 21 | -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata-v2/integrations_v2.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata-v2/missing_metrics_config.diags: -------------------------------------------------------------------------------- 1 | (Critical) integration agent is looking for an undefined metrics config: not_default 2 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata-v2/missing_metrics_config.yaml: -------------------------------------------------------------------------------- 1 | metrics: 2 | global: 3 | remote_write: 4 | - url: http://localhost:9009/api/prom/push 5 | configs: 6 | - name: default 7 | 8 | integrations: 9 | agent: 10 | instance: "default" 11 | autoscrape: 12 | metrics_instance: "not_default" -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata-v2_windows/integrations_v2.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata-v2_windows/integrations_v2.yaml: -------------------------------------------------------------------------------- 1 | metrics: 2 | global: 3 | remote_write: 4 | - url: http://localhost:9009/api/prom/push 5 | configs: 6 | - name: default 7 | 8 | integrations: 9 | windows: 10 | autoscrape: 11 | metrics_instance: "default" -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/dup_labels.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. 2 | (Critical) duplicate label after conversion "discovery.consul.metrics_name_job_test". this is due to how valid flow labels are assembled and can be avoided by updating named properties in the source config. 3 | (Critical) duplicate label after conversion "prometheus.scrape.metrics_name_job_test". this is due to how valid flow labels are assembled and can be avoided by updating named properties in the source config. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/integrations.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/integrations_no_rw.diags: -------------------------------------------------------------------------------- 1 | (Error) The converter does not support handling integrations which are not connected to a remote_write. 2 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/integrations_no_rw.yaml: -------------------------------------------------------------------------------- 1 | integrations: 2 | node_exporter: 3 | scrape_integration: true 4 | enabled: true -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/prom_missing_name.diags: -------------------------------------------------------------------------------- 1 | (Critical) failed to parse Static config: error in config file: error validating instance at index 0: missing instance name -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/prom_missing_name.yaml: -------------------------------------------------------------------------------- 1 | metrics: 2 | configs: 3 | - remote_write: 4 | - url: http://localhost:9010/api/prom/push 5 | -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/prom_remote_write.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/prom_scrape.diags: -------------------------------------------------------------------------------- 1 | (Error) The converter does not support converting the provided global evaluation_interval config. 2 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. 3 | (Warning) The converter does not support converting the provided metrics wal_directory config: Use the run command flag --storage.path for Flow mode instead. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/promtail_scrape.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/sanitize.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. 2 | (Warning) The converter does not support converting the provided metrics wal_directory config: Use the run command flag --storage.path for Flow mode instead. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/traces.diags: -------------------------------------------------------------------------------- 1 | (Warning) automatic_logging for traces has no direct flow equivalent. A best effort translation has been made to otelcol.exporter.logging but the behavior will differ. 2 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata/traces_multi.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata_linux/promtail_prom.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata_windows/integrations.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata_windows/integrations.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: debug 3 | log_format: json 4 | http_tls_config: 5 | client_auth_type: "VerifyClientCertIfGiven" 6 | windows_certificate_filter: 7 | server: 8 | store: "something" 9 | client: 10 | issuer_common_names: 11 | - "1" 12 | subject_regex: "2" 13 | template_id: "something2" 14 | 15 | metrics: 16 | global: 17 | remote_write: 18 | - url: http://localhost:9009/api/prom/push 19 | 20 | integrations: 21 | scrape_integrations: true 22 | windows_exporter: 23 | enabled: true -------------------------------------------------------------------------------- /internal/converter/internal/staticconvert/testdata_windows/promtail_prom.diags: -------------------------------------------------------------------------------- 1 | (Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary. -------------------------------------------------------------------------------- /internal/flow/componenttest/context.go: -------------------------------------------------------------------------------- 1 | package componenttest 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | ) 7 | 8 | // TestContext returns a context which cancels itself when t finishes. 9 | func TestContext(t testing.TB) context.Context { 10 | ctx, cancel := context.WithCancel(context.Background()) 11 | t.Cleanup(cancel) 12 | return ctx 13 | } 14 | -------------------------------------------------------------------------------- /internal/flow/internal/testcomponents/doc.go: -------------------------------------------------------------------------------- 1 | // Package testcomponents contains components useful for testing. They are not 2 | // intended to be exposed by end users and so this package should only be 3 | // imported in tests. 4 | package testcomponents 5 | -------------------------------------------------------------------------------- /internal/flow/internal/testservices/doc.go: -------------------------------------------------------------------------------- 1 | // Package testservices contains services useful for testing. They are not 2 | // intended to be exposed by end users and so this package should only be 3 | // imported in tests. 4 | package testservices 5 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_error/import_error_1.txtar: -------------------------------------------------------------------------------- 1 | Imported declare tries to access declare at the root. 2 | 3 | -- main.river -- 4 | declare "cantAccessThis" { 5 | export "output" { 6 | value = -1 7 | } 8 | } 9 | 10 | import.string "testImport" { 11 | content = ` declare "a" { 12 | cantAccessThis "default" {} 13 | }` 14 | } 15 | 16 | testImport.a "cc" {} 17 | 18 | -- error -- 19 | cannot find the definition of component name "cantAccessThis" 20 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_error/import_error_2.txtar: -------------------------------------------------------------------------------- 1 | Root tries to access declare in nested import. 2 | 3 | -- main.river -- 4 | import.string "testImport" { 5 | content = `import.string "nestedImport" { 6 | content = 'declare "cantAccessThis" {}' 7 | }` 8 | } 9 | 10 | testImport.cantAccessThis "cc" {} 11 | 12 | -- error -- 13 | Failed to build component: loading custom component controller: custom component config not found in the registry, namespace: "testImport", componentName: "cantAccessThis" 14 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_error/import_error_3.txtar: -------------------------------------------------------------------------------- 1 | Use of an imported component with too low stability level propagates the error 2 | 3 | -- main.river -- 4 | 5 | import.string "testImport" { 6 | content = ` declare "a" { 7 | testcomponents.experimental "unstable" {} 8 | }` 9 | } 10 | 11 | testImport.a "cc" {} 12 | 13 | -- error -- 14 | component "testcomponents.experimental" is at stability level "experimental", which is below the minimum allowed stability level "beta" 15 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_error/import_error_4.txtar: -------------------------------------------------------------------------------- 1 | Use of a nested declare component with too low stability level propagates the error 2 | 3 | -- main.river -- 4 | 5 | declare "a" { 6 | 7 | declare "b" { 8 | testcomponents.experimental "unstable" {} 9 | } 10 | 11 | b "cc" {} 12 | 13 | } 14 | 15 | a "cc" {} 16 | 17 | -- error -- 18 | component "testcomponents.experimental" is at stability level "experimental", which is below the minimum allowed stability level "beta" 19 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_git/import_git_1.txtar: -------------------------------------------------------------------------------- 1 | Import passthrough module. 2 | 3 | -- main.river -- 4 | testcomponents.count "inc" { 5 | frequency = "10ms" 6 | max = 10 7 | } 8 | 9 | import.git "testImport" { 10 | repository = "https://github.com/wildum/module.git" 11 | path = "module_passthrough.river" 12 | } 13 | 14 | testImport.a "cc" { 15 | input = testcomponents.count.inc.count 16 | } 17 | 18 | testcomponents.summation "sum" { 19 | input = testImport.a.cc.output 20 | } 21 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_git/import_git_2.txtar: -------------------------------------------------------------------------------- 1 | Import passthrough module from a directory stored in a git repository. 2 | 3 | -- main.river -- 4 | testcomponents.count "inc" { 5 | frequency = "10ms" 6 | max = 10 7 | } 8 | 9 | import.git "testImport" { 10 | repository = "https://github.com/wildum/module.git" 11 | path = "passthrough" 12 | } 13 | 14 | testImport.a "cc" { 15 | input = testcomponents.count.inc.count 16 | } 17 | 18 | testcomponents.summation "sum" { 19 | input = testImport.a.cc.output 20 | } 21 | -------------------------------------------------------------------------------- /internal/flow/testdata/import_http/import_http_1.txtar: -------------------------------------------------------------------------------- 1 | Import passthrough module. 2 | 3 | -- main.river -- 4 | testcomponents.count "inc" { 5 | frequency = "10ms" 6 | max = 10 7 | } 8 | 9 | import.http "testImport" { 10 | url = "https://raw.githubusercontent.com/wildum/module/master/module_passthrough.river" 11 | } 12 | 13 | testImport.a "cc" { 14 | input = testcomponents.count.inc.count 15 | } 16 | 17 | testcomponents.summation "sum" { 18 | input = testImport.a.cc.output 19 | } -------------------------------------------------------------------------------- /internal/flow/tracing/internal/jaegerremote/README.md: -------------------------------------------------------------------------------- 1 | # jaegerremote 2 | 3 | This package contains a temporary fork of 4 | the `go.opentelemetry.io/contrib/samplers/jaegerremote@v0.5.2` module which is 5 | used to work around an issue where importing the OpenTelemetry Collector Jaeger 6 | receiver and jaegerremote modules causes a run-time panic. 7 | 8 | See [open-telemetry/opentelemetry-go-contrib#2981][upstream-issue] for tracking 9 | the issue that led to the need for this fork. 10 | 11 | [upstream-issue]: (https://github.com/open-telemetry/opentelemetry-go-contrib/issues/2981) 12 | -------------------------------------------------------------------------------- /internal/flowmode/cluster_builder_test.go: -------------------------------------------------------------------------------- 1 | package flowmode 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestBuildClusterService(t *testing.T) { 10 | opts := clusterOptions{ 11 | JoinPeers: []string{"foo", "bar"}, 12 | DiscoverPeers: "provider=aws key1=val1 key2=val2", 13 | } 14 | 15 | cs, err := buildClusterService(opts) 16 | require.Nil(t, cs) 17 | require.EqualError(t, err, "at most one of join peers and discover peers may be set") 18 | } 19 | -------------------------------------------------------------------------------- /internal/service/http/handler.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package http 4 | 5 | import ( 6 | "crypto/tls" 7 | "fmt" 8 | 9 | "github.com/grafana/agent/static/server" 10 | ) 11 | 12 | // tlsConfig generates a tls.Config from args. 13 | func (args *TLSArguments) winTlsConfig(_ *server.WinCertStoreHandler) (*tls.Config, error) { 14 | return nil, fmt.Errorf("Windows Certificate filter is only available on Windows platforms.") 15 | } 16 | 17 | func (s *Service) updateWindowsCertificateFilter(_ *TLSArguments) error { 18 | return fmt.Errorf("Windows Certificate filter is only available on Windows platforms.") 19 | } 20 | -------------------------------------------------------------------------------- /internal/service/http/routes.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "net/http" 5 | "sort" 6 | "strings" 7 | ) 8 | 9 | type serviceRoute struct { 10 | Base string 11 | Handler http.Handler 12 | } 13 | 14 | // serviceRoutes is a sortable collection of serviceRoute. 15 | type serviceRoutes []serviceRoute 16 | 17 | var _ sort.Interface = (serviceRoutes)(nil) 18 | 19 | func (sr serviceRoutes) Len() int { return len(sr) } 20 | 21 | func (sr serviceRoutes) Less(i, j int) bool { 22 | // Prefer longer paths. 23 | return strings.Count(sr[i].Base, "/") > strings.Count(sr[j].Base, "/") 24 | } 25 | 26 | func (sr serviceRoutes) Swap(i, j int) { 27 | sr[i], sr[j] = sr[j], sr[i] 28 | } 29 | -------------------------------------------------------------------------------- /internal/util/metrics.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "github.com/prometheus/client_golang/prometheus" 4 | 5 | // MustRegisterOrGet will attempt to register the supplied collector into the register. If it's already 6 | // registered, it will return that one. 7 | // In case that the register procedure fails with something other than already registered, this will panic. 8 | func MustRegisterOrGet(reg prometheus.Registerer, c prometheus.Collector) prometheus.Collector { 9 | if err := reg.Register(c); err != nil { 10 | if are, ok := err.(prometheus.AlreadyRegisteredError); ok { 11 | return are.ExistingCollector 12 | } 13 | panic(err) 14 | } 15 | return c 16 | } 17 | -------------------------------------------------------------------------------- /internal/util/strings.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | // CamelToSnake is a helper function for converting CamelCase to Snake Case 9 | func CamelToSnake(str string) string { 10 | var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") 11 | var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") 12 | snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}") 13 | snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}") 14 | return strings.ToLower(snake) 15 | } 16 | -------------------------------------------------------------------------------- /internal/util/trigger_test.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | "time" 7 | 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestWaitTrigger(t *testing.T) { 12 | t.Run("timeout", func(t *testing.T) { 13 | wt := NewWaitTrigger() 14 | err := wt.Wait(time.Millisecond * 100) 15 | require.ErrorIs(t, err, context.DeadlineExceeded) 16 | }) 17 | 18 | t.Run("no timeout", func(t *testing.T) { 19 | wt := NewWaitTrigger() 20 | 21 | go func() { 22 | <-time.After(100 * time.Millisecond) 23 | wt.Trigger() 24 | }() 25 | 26 | err := wt.Wait(time.Second) 27 | require.NoError(t, err) 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /internal/util/untab.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "strings" 4 | 5 | // Untab is a utility function for tests to make it easier 6 | // to write YAML tests, where some editors will insert tabs 7 | // into strings by default. 8 | func Untab(s string) string { 9 | return strings.ReplaceAll(s, "\t", " ") 10 | } 11 | -------------------------------------------------------------------------------- /internal/web/ui/.env: -------------------------------------------------------------------------------- 1 | REACT_APP_BASE_URL= 2 | GENERATE_SOURCEMAP=false 3 | -------------------------------------------------------------------------------- /internal/web/ui/.env.production: -------------------------------------------------------------------------------- 1 | # The template syntax below is injected into compiled code and then replaced by 2 | # the Go server through text/template to insert the PublicURL at runtime. 3 | REACT_APP_BASE_URL={{! .PublicURL !}} 4 | PUBLIC_URL=./public 5 | -------------------------------------------------------------------------------- /internal/web/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /internal/web/ui/README.md: -------------------------------------------------------------------------------- 1 | # Grafana Agent Flow UI 2 | 3 | ## Prerequisites 4 | 5 | * Yarn >= v1.22 6 | * Node.js >= v16 7 | -------------------------------------------------------------------------------- /internal/web/ui/assets_builtin.go: -------------------------------------------------------------------------------- 1 | //go:build builtinassets 2 | 3 | package ui 4 | 5 | import ( 6 | "embed" 7 | "io/fs" 8 | "net/http" 9 | ) 10 | 11 | //go:generate yarn 12 | //go:generate yarn run build 13 | 14 | //go:embed build 15 | var builtinAssetsTarball embed.FS 16 | 17 | // Assets contains the UI's assets. 18 | func Assets() http.FileSystem { 19 | inner, err := fs.Sub(builtinAssetsTarball, "build") 20 | if err != nil { 21 | panic(err) 22 | } 23 | return http.FS(inner) 24 | } 25 | -------------------------------------------------------------------------------- /internal/web/ui/assets_nobuiltin.go: -------------------------------------------------------------------------------- 1 | //go:build !builtinassets 2 | 3 | package ui 4 | 5 | import ( 6 | "net/http" 7 | "path/filepath" 8 | ) 9 | 10 | // Assets contains the UI's assets. 11 | func Assets() http.FileSystem { 12 | assetsDir := filepath.Join(".", "internal", "web", "ui", "build") 13 | return http.Dir(assetsDir) 14 | } 15 | -------------------------------------------------------------------------------- /internal/web/ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/public/favicon.ico -------------------------------------------------------------------------------- /internal/web/ui/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Grafana Agent", 3 | "name": "Grafana Agent", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /internal/web/ui/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /internal/web/ui/src/App.module.css: -------------------------------------------------------------------------------- 1 | .app { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100%; 5 | } 6 | 7 | .app main { 8 | flex-grow: 1; 9 | overflow-y: hidden; 10 | } 11 | -------------------------------------------------------------------------------- /internal/web/ui/src/features/clustering/Table.module.css: -------------------------------------------------------------------------------- 1 | .table { 2 | border-collapse: collapse; 3 | width: 100%; 4 | } 5 | 6 | .table td, 7 | .table th { 8 | border: none; 9 | padding: 0px 8px; 10 | } 11 | 12 | .table tr:nth-child(odd) { 13 | background-color: #f4f5f5; 14 | } 15 | 16 | .table tr:nth-child(even) { 17 | background-color: white; 18 | } 19 | 20 | .table tr:hover { 21 | background-color: #ddd; 22 | } 23 | 24 | .table th { 25 | padding: 8px; 26 | text-align: left; 27 | background-color: #f4f5f5; 28 | color: rgba(36, 41, 46, 0.75); 29 | } 30 | 31 | .table td:first-child { 32 | width: 25%; 33 | } 34 | -------------------------------------------------------------------------------- /internal/web/ui/src/features/clustering/types.ts: -------------------------------------------------------------------------------- 1 | export interface PeerInfo { 2 | name: string; 3 | 4 | addr: string; 5 | 6 | state: string; 7 | 8 | isSelf: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /internal/web/ui/src/features/river-js/RiverValue.module.css: -------------------------------------------------------------------------------- 1 | .value { 2 | font-size: 14px; 3 | font-family: 'Fira Code', monospace; 4 | white-space: pre; 5 | tab-size: 4; 6 | margin: 0px; 7 | } 8 | 9 | .value span.literal { 10 | color: blue; 11 | } 12 | 13 | .value span.string { 14 | color: green; 15 | } 16 | 17 | .value span.special { 18 | color: gray; 19 | } 20 | -------------------------------------------------------------------------------- /internal/web/ui/src/index.css: -------------------------------------------------------------------------------- 1 | @import url('./static/fonts.css'); 2 | 3 | html, body, #root { 4 | height: 100%; 5 | } 6 | 7 | body { 8 | background-color: #f4f4f5; 9 | font-family: 'Roboto', sans-serif; 10 | } 11 | 12 | .app-navbar { 13 | background-color: #ffffff; 14 | border-bottom: 1px solid #e4e5e5; 15 | } 16 | 17 | .app-navbar .navbar-brand img:hover { 18 | cursor: pointer; 19 | } 20 | 21 | .app-navbar div[role="menu"] { 22 | border: 1px solid #e4e5e5; 23 | } 24 | 25 | .app-navbar a { 26 | color: #25292e; 27 | } 28 | 29 | pre, code { 30 | font-family: 'Fira Code', monospace; 31 | } 32 | -------------------------------------------------------------------------------- /internal/web/ui/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | 4 | import App from './App'; 5 | 6 | import 'normalize.css'; 7 | import './index.css'; 8 | 9 | const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); 10 | root.render( 11 | 12 | 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /internal/web/ui/src/pages/Clustering.tsx: -------------------------------------------------------------------------------- 1 | import { faNetworkWired } from '@fortawesome/free-solid-svg-icons'; 2 | 3 | import PeerList from '../features/clustering/PeerList'; 4 | import Page from '../features/layout/Page'; 5 | import { usePeerInfo } from '../hooks/peerInfo'; 6 | 7 | function PageClusteringPeers() { 8 | const peers = usePeerInfo(); 9 | 10 | return ( 11 | 12 | 13 | 14 | ); 15 | } 16 | 17 | export default PageClusteringPeers; 18 | -------------------------------------------------------------------------------- /internal/web/ui/src/pages/Graph.tsx: -------------------------------------------------------------------------------- 1 | import { faDiagramProject } from '@fortawesome/free-solid-svg-icons'; 2 | 3 | import { ComponentGraph } from '../features/graph/ComponentGraph'; 4 | import Page from '../features/layout/Page'; 5 | import { useComponentInfo } from '../hooks/componentInfo'; 6 | 7 | function Graph() { 8 | const [components] = useComponentInfo(''); 9 | 10 | return ( 11 | 12 | {components.length > 0 && } 13 | 14 | ); 15 | } 16 | 17 | export default Graph; 18 | -------------------------------------------------------------------------------- /internal/web/ui/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/fira-code-v21-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/fira-code-v21-latin-500.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/fira-code-v21-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/fira-code-v21-latin-regular.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-100.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-100.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-100italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-100italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-300.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-300italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-500.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-500italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-500italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-700.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-700italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-700italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-900.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-900italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-900italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-italic.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/static/fonts/roboto-v30-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/internal/web/ui/src/static/fonts/roboto-v30-latin-regular.woff2 -------------------------------------------------------------------------------- /internal/web/ui/src/utils/id.ts: -------------------------------------------------------------------------------- 1 | type ID = { 2 | moduleID: string; 3 | localID: string; 4 | }; 5 | 6 | /** 7 | * parseID parses a full component ID into its moduleID and localID halves. 8 | */ 9 | export function parseID(id: string): ID { 10 | const lastSlashIndex = id.lastIndexOf('/'); 11 | if (lastSlashIndex === -1) { 12 | return { moduleID: '', localID: id }; 13 | } 14 | 15 | return { 16 | moduleID: id.slice(0, lastSlashIndex), 17 | localID: id.slice(lastSlashIndex + 1), 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /internal/web/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/alerts.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+: { 3 | groups+: [ 4 | (import './alerts/clustering.libsonnet'), 5 | (import './alerts/controller.libsonnet'), 6 | (import './alerts/opentelemetry.libsonnet'), 7 | ], 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/alerts/utils/alert.jsonnet: -------------------------------------------------------------------------------- 1 | // alert.jsonnet defines utilities to create alerts. 2 | 3 | { 4 | newGroup(name, rules):: { 5 | name: name, 6 | rules: rules, 7 | }, 8 | 9 | newRule(name='', expr='', message='', forT=''):: std.prune({ 10 | alert: name, 11 | expr: expr, 12 | annotations: { 13 | message: message, 14 | }, 15 | 'for': forT, 16 | }), 17 | } 18 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/dashboards.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | grafanaDashboards+: 3 | (import './dashboards/controller.libsonnet') + 4 | (import './dashboards/resources.libsonnet') + 5 | (import './dashboards/prometheus.libsonnet') + 6 | (import './dashboards/cluster-node.libsonnet') + 7 | (import './dashboards/opentelemetry.libsonnet') + 8 | (import './dashboards/cluster-overview.libsonnet'), 9 | } 10 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/grizzly/alerts.jsonnet: -------------------------------------------------------------------------------- 1 | local mixin = import '../mixin.libsonnet'; 2 | 3 | { 4 | prometheus_rules: std.map( 5 | function(group) 6 | { 7 | apiVersion: 'grizzly.grafana.com/v1alpha1', 8 | kind: 'PrometheusRuleGroup', 9 | metadata: { 10 | namespace: 'agent-flow', 11 | name: group.name, 12 | }, 13 | spec: group, 14 | }, 15 | mixin.prometheusAlerts.groups 16 | ), 17 | } 18 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": [], 4 | "legacyImports": true 5 | } 6 | -------------------------------------------------------------------------------- /operations/agent-flow-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | { grafanaDashboardFolder: 'Grafana Agent Flow' } + 2 | (import './dashboards.libsonnet') + 3 | (import './alerts.libsonnet') 4 | -------------------------------------------------------------------------------- /operations/agent-static-mixin/config.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local makeGroupBy(groups) = std.join(', ', groups), 3 | 4 | _config+:: { 5 | namespace: '.*', 6 | 7 | // Groups labels to uniquely identify and group by clusters 8 | cluster_selectors: ['cluster', 'namespace'], 9 | 10 | // Each group-by label list is `, `-separated and unique identifies 11 | group_by_cluster: makeGroupBy($._config.cluster_selectors), 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /operations/agent-static-mixin/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "grafana-builder", 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/grafana/jsonnet-libs", 8 | "subdir": "grafana-builder" 9 | } 10 | }, 11 | "version": "master" 12 | }, 13 | { 14 | "name": "grafonnet", 15 | "source": { 16 | "git": { 17 | "remote": "https://github.com/grafana/grafonnet-lib", 18 | "subdir": "grafonnet" 19 | } 20 | }, 21 | "version": "master" 22 | } 23 | ] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /operations/agent-static-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | { grafanaDashboardFolder: 'Grafana Agent' } 2 | + (import 'dashboards.libsonnet') 3 | + (import 'debugging.libsonnet') 4 | + (import 'alerts.libsonnet') 5 | -------------------------------------------------------------------------------- /operations/helm/Makefile: -------------------------------------------------------------------------------- 1 | # Docs generated by https://github.com/norwoodj/helm-docs 2 | docs: 3 | cd charts/grafana-agent && helm-docs 4 | 5 | rebuild-tests: 6 | bash ./scripts/rebuild-tests.sh 7 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | 25 | # Don't package templates. 26 | README.md.gotmpl 27 | 28 | # Don't packages the tests used for CI. 29 | /tests/ 30 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: grafana-agent 3 | description: 'Grafana Agent' 4 | type: application 5 | version: 0.44.2 6 | appVersion: 'v0.44.2' 7 | 8 | dependencies: 9 | - name: crds 10 | version: "0.0.0" 11 | condition: crds.create 12 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/charts/crds/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: crds 3 | version: 0.0.0 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/additional-serviceaccount-label-values.yaml: -------------------------------------------------------------------------------- 1 | serviceAccount: 2 | additionalLabels: 3 | test: "true" 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/clustering-values.yaml: -------------------------------------------------------------------------------- 1 | agent: 2 | mode: 'flow' 3 | clustering: 4 | enabled: true 5 | 6 | controller: 7 | type: 'statefulset' 8 | replicas: 3 9 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/controller-volumes-extra-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | volumes: 3 | extra: 4 | - name: cache-volume 5 | emptyDir: 6 | sizeLimit: 500Mi 7 | 8 | agent: 9 | mounts: 10 | extra: 11 | - mountPath: /cache 12 | name: cache-volume 13 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/create-daemonset-hostnetwork-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the controller explicitly set to DaemonSet. 2 | controller: 3 | type: daemonset 4 | hostNetwork: true 5 | dnsPolicy: ClusterFirstWithHostNet 6 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/create-daemonset-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the controller explicitly set to DaemonSet. 2 | controller: 3 | type: daemonset 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/create-deployment-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the controller explicitly set to Deployment. 2 | controller: 3 | type: deployment 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the controller explicitly set to StatefulSet and autoscaling enabled. 2 | controller: 3 | type: statefulset 4 | autoscaling: 5 | enabled: true 6 | enableStatefulSetAutoDeletePVC: true 7 | agent: 8 | resources: 9 | requests: 10 | memory: 100Mi 11 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/create-statefulset-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the controller explicitly set to StatefulSet. 2 | controller: 3 | type: statefulset 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/custom-config-values.yaml: -------------------------------------------------------------------------------- 1 | agent: 2 | configMap: 3 | content: |- 4 | logging { 5 | level = "warn" 6 | format = "logfmt" 7 | } 8 | discovery.kubernetes "custom_pods" { 9 | role = "pod" 10 | } 11 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/default-values-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with everything set to the default values. 2 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/enable-servicemonitor-tls-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the service monitor enabled 2 | agent: 3 | listenScheme: HTTPS 4 | service: 5 | enabled: true 6 | serviceMonitor: 7 | enabled: true 8 | tlsConfig: 9 | insecureSkipVerify: true 10 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/enable-servicemonitor-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the service monitor enabled 2 | service: 3 | enabled: true 4 | serviceMonitor: 5 | enabled: true 6 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/envFrom-values.yaml: -------------------------------------------------------------------------------- 1 | # Specify extra ports for verifying rendering the template works 2 | agent: 3 | envFrom: 4 | - configMapRef: 5 | name: special-config 6 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/existing-config-values.yaml: -------------------------------------------------------------------------------- 1 | agent: 2 | configMap: 3 | create: false 4 | name: existing-config 5 | key: my-config.river 6 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/extra-env-values.yaml: -------------------------------------------------------------------------------- 1 | # Specify extra ports for verifying rendering the template works 2 | agent: 3 | extraEnv: 4 | - name: GREETING 5 | value: "Warm greetings to" 6 | - name: HONORIFIC 7 | value: "The Most Honorable" 8 | - name: NAME 9 | value: "Kubernetes" 10 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/extra-ports-values.yaml: -------------------------------------------------------------------------------- 1 | # Specify extra ports for verifying rendering the template works 2 | agent: 3 | extraPorts: 4 | - name: jaeger-thrift 5 | port: 14268 6 | targetPort: 14268 7 | protocol: TCP 8 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/faro-ingress-values.yaml: -------------------------------------------------------------------------------- 1 | agent: 2 | extraPorts: 3 | - name: "faro" 4 | port: 12347 5 | targetPort: 12347 6 | protocol: "TCP" 7 | 8 | ingress: 9 | enabled: true 10 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/global-image-pullsecrets-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the global image pull secret explicitly set. 2 | global: 3 | image: 4 | pullSecrets: 5 | - name: global-cred 6 | 7 | podSecurityContext: 8 | runAsUser: 1000 9 | runAsGroup: 1000 10 | 11 | image: 12 | pullSecrets: 13 | - name: local-cred 14 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/global-image-registry-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the global image registry explicitly set to another value. 2 | global: 3 | image: 4 | registry: quay.io 5 | 6 | image: 7 | registry: docker.com # Invalid value by default 8 | 9 | configReloader: 10 | image: 11 | registry: docker.com 12 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/local-image-pullsecrets-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the agent image pull secret explicitly set. 2 | image: 3 | pullSecrets: 4 | - name: local-cred 5 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/local-image-registry-values.yaml: -------------------------------------------------------------------------------- 1 | # Test rendering of the chart with the individual image registries explicitly set to another value. 2 | image: 3 | registry: quay.io 4 | 5 | configReloader: 6 | image: 7 | registry: quay.io 8 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/nodeselectors-and-tolerations-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | nodeSelector: 3 | key1: "value1" 4 | tolerations: 5 | - key: "key1" 6 | operator: "Equal" 7 | value: "value1" 8 | effect: "NoSchedule" 9 | - key: "key2" 10 | operator: "Exists" 11 | effect: "NoSchedule" 12 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/nonroot-values.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | podSecurityContext: 3 | fsGroup: 473 4 | agent: 5 | securityContext: 6 | runAsUser: 473 7 | runAsGroup: 473 8 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/pod_annotations-values.yaml: -------------------------------------------------------------------------------- 1 | # Test correct rendering of the pod annotations 2 | controller: 3 | podAnnotations: 4 | testAnnotationKey: testAnnotationValue 5 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/static-mode-values.yaml: -------------------------------------------------------------------------------- 1 | agent: 2 | mode: static 3 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/topologyspreadconstraints-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | type: deployment 3 | topologySpreadConstraints: 4 | - maxSkew: 1 5 | topologyKey: topology.kubernetes.io/zone 6 | whenUnsatisfiable: ScheduleAnyway 7 | labelSelector: 8 | matchLabels: 9 | app.kubernetes.io/name: grafana-agent 10 | app.kubernetes.io/instance: grafana-agent 11 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/ci/with-digests-values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | registry: "docker.io" 3 | repository: "grafana/agent" 4 | digest: "sha256:82575a7be3e4770e53f620298e58bcc4cdb0fd0338e01c4b206cae9e3ca46ebf" 5 | 6 | configReloader: 7 | image: 8 | registry: "docker.io" 9 | repository: "jimmidyson/configmap-reload" 10 | digest: "sha256:5af9d3041d12a3e63f115125f89b66d2ba981fe82e64302ac370c5496055059c" 11 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/config/example.river: -------------------------------------------------------------------------------- 1 | logging { 2 | level = "info" 3 | format = "logfmt" 4 | } 5 | 6 | discovery.kubernetes "pods" { 7 | role = "pod" 8 | } 9 | 10 | discovery.kubernetes "nodes" { 11 | role = "node" 12 | } 13 | 14 | discovery.kubernetes "services" { 15 | role = "service" 16 | } 17 | 18 | discovery.kubernetes "endpoints" { 19 | role = "endpoints" 20 | } 21 | 22 | discovery.kubernetes "endpointslices" { 23 | role = "endpointslice" 24 | } 25 | 26 | discovery.kubernetes "ingresses" { 27 | role = "ingress" 28 | } 29 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/config/example.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: info 3 | log_format: logfmt 4 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Welcome to Grafana Agent! 2 | -------------------------------------------------------------------------------- /operations/helm/charts/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "grafana-agent.serviceAccountName" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{- include "grafana-agent.labels" . | nindent 4 }} 9 | {{- with .Values.serviceAccount.additionalLabels }} 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- with .Values.serviceAccount.annotations }} 13 | annotations: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | {{- end }} 17 | -------------------------------------------------------------------------------- /operations/helm/cr.yaml: -------------------------------------------------------------------------------- 1 | owner: grafana 2 | git-repo: helm-charts 3 | skip-existing: true 4 | -------------------------------------------------------------------------------- /operations/helm/ct.yaml: -------------------------------------------------------------------------------- 1 | remote: origin 2 | target-branch: main 3 | chart-dirs: 4 | - operations/helm/charts 5 | validate-maintainers: false 6 | check-version-increment: false # Don't require every change to be released 7 | -------------------------------------------------------------------------------- /operations/helm/tests/additional-serviceaccount-label/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | test: "true" 15 | -------------------------------------------------------------------------------- /operations/helm/tests/clustering/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/controller-volumes-extra/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-daemonset-hostnetwork/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-daemonset/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-deployment-autoscaling/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-deployment/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-statefulset-autoscaling/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/create-statefulset/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/custom-config/grafana-agent/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/configmap.yaml 3 | apiVersion: v1 4 | kind: ConfigMap 5 | metadata: 6 | name: grafana-agent 7 | labels: 8 | helm.sh/chart: grafana-agent 9 | app.kubernetes.io/name: grafana-agent 10 | app.kubernetes.io/instance: grafana-agent 11 | app.kubernetes.io/version: "vX.Y.Z" 12 | app.kubernetes.io/managed-by: Helm 13 | data: 14 | config.river: |- 15 | logging { 16 | level = "warn" 17 | format = "logfmt" 18 | } 19 | discovery.kubernetes "custom_pods" { 20 | role = "pod" 21 | } 22 | -------------------------------------------------------------------------------- /operations/helm/tests/custom-config/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/default-values/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/enable-servicemonitor-tls/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/enable-servicemonitor/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/envFrom/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/existing-config/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/extra-env/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/extra-ports/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/faro-ingress/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/global-image-pullsecrets/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/global-image-registry/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/initcontainers/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/local-image-pullsecrets/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/local-image-registry/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/nodeselectors-and-tolerations/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/nonroot/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/pod_annotations/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/sidecars/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/static-mode/grafana-agent/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/configmap.yaml 3 | apiVersion: v1 4 | kind: ConfigMap 5 | metadata: 6 | name: grafana-agent 7 | labels: 8 | helm.sh/chart: grafana-agent 9 | app.kubernetes.io/name: grafana-agent 10 | app.kubernetes.io/instance: grafana-agent 11 | app.kubernetes.io/version: "vX.Y.Z" 12 | app.kubernetes.io/managed-by: Helm 13 | data: 14 | config.yaml: |- 15 | server: 16 | log_level: info 17 | log_format: logfmt 18 | -------------------------------------------------------------------------------- /operations/helm/tests/static-mode/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/topologyspreadconstraints/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/helm/tests/with-digests/grafana-agent/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: grafana-agent/templates/serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: grafana-agent 7 | namespace: default 8 | labels: 9 | helm.sh/chart: grafana-agent 10 | app.kubernetes.io/name: grafana-agent 11 | app.kubernetes.io/instance: grafana-agent 12 | app.kubernetes.io/version: "vX.Y.Z" 13 | app.kubernetes.io/managed-by: Helm 14 | -------------------------------------------------------------------------------- /operations/river-jsonnet/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": [], 4 | "legacyImports": true 5 | } 6 | -------------------------------------------------------------------------------- /operations/river-jsonnet/main.libsonnet: -------------------------------------------------------------------------------- 1 | (import './builder.jsonnet') + 2 | (import './manifest.jsonnet') 3 | -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/deb/control/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # shellcheck disable=SC1091 6 | [ -f /etc/default/grafana-agent-flow ] && . /etc/default/grafana-agent-flow 7 | 8 | if [ "$1" = "remove" ]; then 9 | if command -v systemctl 2>/dev/null; then 10 | systemctl stop grafana-agent-flow.service > /dev/null 2>&1 || : 11 | fi 12 | fi 13 | -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/environment-file: -------------------------------------------------------------------------------- 1 | ## Path: 2 | ## Description: Grafana Agent Flow settings 3 | ## Type: string 4 | ## Default: "" 5 | ## ServiceRestart: grafana-agent-flow 6 | # 7 | # Command line options for grafana-agent 8 | # 9 | # The configuration file holding the agent config. 10 | CONFIG_FILE="/etc/grafana-agent-flow.river" 11 | 12 | # User-defined arguments to pass to the run command. 13 | CUSTOM_ARGS="" 14 | 15 | # Restart on system upgrade. Defaults to true. 16 | RESTART_ON_UPGRADE=true 17 | -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/rpm/control/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # shellcheck disable=SC1091 6 | [ -f /etc/sysconfig/grafana-agent-flow ] && . /etc/sysconfig/grafana-agent-flow 7 | 8 | # final uninstallation $1=0 9 | # If other copies of this RPM are installed, then $1>0 10 | 11 | if [ "$1" -eq 0 ] ; then 12 | if [ -x /bin/systemctl ] ; then 13 | /bin/systemctl stop grafana-agent-flow.service > /dev/null 2>&1 || : 14 | elif [ -x /etc/init.d/grafana-agent-flow ] ; then 15 | /etc/init.d/grafana-agent-flow stop 16 | elif [ -x /etc/rc.d/init.d/grafana-agent-flow ] ; then 17 | /etc/rc.d/init.d/grafana-agent-flow stop 18 | fi 19 | fi 20 | exit 0 21 | -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/windows/config.river: -------------------------------------------------------------------------------- 1 | logging { 2 | level = "info" 3 | } 4 | -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/windows/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/packaging/grafana-agent-flow/windows/logo.ico -------------------------------------------------------------------------------- /packaging/grafana-agent-flow/windows/macros.nsis: -------------------------------------------------------------------------------- 1 | !macro VerifyUserIsAdmin 2 | UserInfo::GetAccountType 3 | Pop $0 4 | ${If} $0 != "admin" # Require admin rights on NT4+ 5 | MessageBox MB_ICONSTOP "Administrator rights required!" 6 | SetErrorLevel 740 # ERROR_ELEVATION_REQUIRED 7 | Quit 8 | ${EndIf} 9 | !macroend 10 | 11 | -------------------------------------------------------------------------------- /packaging/grafana-agent/deb/control/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # shellcheck disable=SC1091 6 | [ -f /etc/default/grafana-agent ] && . /etc/default/grafana-agent 7 | 8 | if [ "$1" = "remove" ]; then 9 | if command -v systemctl 2>/dev/null; then 10 | systemctl stop grafana-agent.service > /dev/null 2>&1 || : 11 | fi 12 | fi 13 | -------------------------------------------------------------------------------- /packaging/grafana-agent/environment-file: -------------------------------------------------------------------------------- 1 | ## Path: 2 | ## Description: Grafana Agent monitoring agent settings 3 | ## Type: string 4 | ## Default: "" 5 | ## ServiceRestart: grafana-agent 6 | # 7 | # Command line options for grafana-agent 8 | # 9 | # The configuration file holding the agent config 10 | CONFIG_FILE="/etc/grafana-agent.yaml" 11 | 12 | # Any user defined arguments 13 | CUSTOM_ARGS="-server.http.address=127.0.0.1:9090 -server.grpc.address=127.0.0.1:9091" 14 | 15 | # Restart on system upgrade. Default to true 16 | RESTART_ON_UPGRADE=true 17 | -------------------------------------------------------------------------------- /packaging/grafana-agent/rpm/control/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # shellcheck disable=SC1091 6 | [ -f /etc/sysconfig/grafana-agent ] && . /etc/sysconfig/grafana-agent 7 | 8 | # final uninstallation $1=0 9 | # If other copies of this RPM are installed, then $1>0 10 | 11 | if [ "$1" -eq 0 ] ; then 12 | if [ -x /bin/systemctl ] ; then 13 | /bin/systemctl stop grafana-agent.service > /dev/null 2>&1 || : 14 | elif [ -x /etc/init.d/grafana-agent ] ; then 15 | /etc/init.d/grafana-agent stop 16 | elif [ -x /etc/rc.d/init.d/grafana-agent ] ; then 17 | /etc/rc.d/init.d/grafana-agent stop 18 | fi 19 | fi 20 | exit 0 21 | -------------------------------------------------------------------------------- /packaging/grafana-agent/windows/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | LICENSE 3 | -------------------------------------------------------------------------------- /packaging/grafana-agent/windows/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian 2 | RUN apt-get update && \ 3 | apt-get install -y nsis 4 | ENTRYPOINT makensis -V4 -DVERSION=$VERSION -DOUT="/home/dist/grafana-agent-installer.exe" /home/packaging/windows/install_script.nsis -------------------------------------------------------------------------------- /packaging/grafana-agent/windows/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/packaging/grafana-agent/windows/logo.ico -------------------------------------------------------------------------------- /static/agentctl/testdata/agent-1.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | write_stale_on_shutdown: true 3 | scrape_configs: 4 | - job_name: agent-1 5 | static_configs: 6 | - targets: ['agent-1:12345'] 7 | labels: 8 | cluster: 'testdata' 9 | origin: 'agent' 10 | container: 'agent-1' 11 | remote_write: 12 | - url: http://cortex:9009/api/prom/push 13 | -------------------------------------------------------------------------------- /static/agentctl/testdata/agent-2.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | write_stale_on_shutdown: true 3 | scrape_configs: 4 | - job_name: agent-2 5 | static_configs: 6 | - targets: ['agent-2:12345'] 7 | labels: 8 | cluster: 'testdata' 9 | origin: 'agent' 10 | container: 'agent-2' 11 | remote_write: 12 | - url: http://cortex:9009/api/prom/push 13 | -------------------------------------------------------------------------------- /static/agentctl/testdata/agent-3.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | write_stale_on_shutdown: true 3 | scrape_configs: 4 | - job_name: agent-3 5 | static_configs: 6 | - targets: ['agent-3:12345'] 7 | labels: 8 | cluster: 'testdata' 9 | origin: 'agent' 10 | container: 'agent-3' 11 | remote_write: 12 | - url: http://cortex:9009/api/prom/push 13 | -------------------------------------------------------------------------------- /static/agentproto/gen.go: -------------------------------------------------------------------------------- 1 | package agentproto 2 | 3 | //go:generate protoc --gogoslick_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc,paths=source_relative:./ ./agent.proto 4 | -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_unknown.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/config/encoder/test_encoding_unknown.txt -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf16be.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/config/encoder/test_encoding_utf16be.txt -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf16le.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/config/encoder/test_encoding_utf16le.txt -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf32be.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/config/encoder/test_encoding_utf32be.txt -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf32le.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/config/encoder/test_encoding_utf32le.txt -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf8.txt: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: ${TEST} -------------------------------------------------------------------------------- /static/config/encoder/test_encoding_utf8bom.txt: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: ${TEST} -------------------------------------------------------------------------------- /static/config/testdata/server_empty.yml: -------------------------------------------------------------------------------- 1 | server: 2 | -------------------------------------------------------------------------------- /static/integrations/cadvisor/cadvisor_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | package cadvisor //nolint:golint 4 | 5 | import ( 6 | "github.com/grafana/agent/static/integrations" 7 | 8 | "github.com/go-kit/log" 9 | "github.com/go-kit/log/level" 10 | ) 11 | 12 | // NewIntegration creates a new cadvisor integration 13 | func (c *Config) NewIntegration(logger log.Logger) (integrations.Integration, error) { 14 | level.Warn(logger).Log("msg", "the cadvisor integration only works on linux; enabling it on other platforms will do nothing") 15 | return &integrations.StubIntegration{}, nil 16 | } 17 | -------------------------------------------------------------------------------- /static/integrations/cloudwatch_exporter/docs/template.md: -------------------------------------------------------------------------------- 1 | ## Supported services in discovery jobs 2 | 3 | The following is a list of AWS services that are supported in `cloudwatch_exporter` discovery jobs. When configuring a 4 | discovery job, the `type` field of each `discovery_job` must match either the desired job namespace or alias. 5 | 6 | {{SERVICE_LIST}} 7 | -------------------------------------------------------------------------------- /static/integrations/github_exporter/github_test.go: -------------------------------------------------------------------------------- 1 | package github_exporter //nolint:golint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/static/config" 7 | // register github_exporter 8 | ) 9 | 10 | func TestConfig_SecretGithub(t *testing.T) { 11 | stringCfg := ` 12 | prometheus: 13 | wal_directory: /tmp/agent 14 | integrations: 15 | github_exporter: 16 | enabled: true 17 | api_token: secret_api` 18 | config.CheckSecret(t, stringCfg, "secret_api") 19 | } 20 | -------------------------------------------------------------------------------- /static/integrations/kafka_exporter/kafka_test.go: -------------------------------------------------------------------------------- 1 | package kafka_exporter //nolint:golint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/static/config" 7 | ) 8 | 9 | func TestConfig_SecretKafkaPassword(t *testing.T) { 10 | stringCfg := ` 11 | prometheus: 12 | wal_directory: /tmp/agent 13 | integrations: 14 | kafka_exporter: 15 | enabled: true 16 | sasl_password: secret_password 17 | ` 18 | config.CheckSecret(t, stringCfg, "secret_password") 19 | } 20 | -------------------------------------------------------------------------------- /static/integrations/mongodb_exporter/mongodb_test.go: -------------------------------------------------------------------------------- 1 | package mongodb_exporter //nolint:golint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/static/config" 7 | ) 8 | 9 | func TestConfig_SecretMongoDB(t *testing.T) { 10 | stringCfg := ` 11 | prometheus: 12 | wal_directory: /tmp/agent 13 | integrations: 14 | mongodb_exporter: 15 | enabled: true 16 | mongodb_uri: secret_password_in_uri 17 | ` 18 | config.CheckSecret(t, stringCfg, "secret_password_in_uri") 19 | } 20 | -------------------------------------------------------------------------------- /static/integrations/mysqld_exporter/mysqld_test.go: -------------------------------------------------------------------------------- 1 | package mysqld_exporter //nolint:golint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/static/config" 7 | ) 8 | 9 | func TestConfig_SecretMysqlD(t *testing.T) { 10 | stringCfg := ` 11 | prometheus: 12 | wal_directory: /tmp/agent 13 | integrations: 14 | mysqld_exporter: 15 | enabled: true 16 | data_source_name: root:secret_password@myserver:3306` 17 | config.CheckSecret(t, stringCfg, "secret_password") 18 | } 19 | -------------------------------------------------------------------------------- /static/integrations/node_exporter/node_exporter_linux.go: -------------------------------------------------------------------------------- 1 | package node_exporter //nolint:golint 2 | 3 | import ( 4 | "github.com/prometheus/procfs/sysfs" 5 | ) 6 | 7 | func init() { 8 | DefaultConfig.SysFSPath = sysfs.DefaultMountPoint 9 | } 10 | -------------------------------------------------------------------------------- /static/integrations/postgres_exporter/postgres_test.go: -------------------------------------------------------------------------------- 1 | package postgres_exporter //nolint:golint 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/grafana/agent/static/config" 7 | ) 8 | 9 | func TestConfig_SecretPostgres(t *testing.T) { 10 | stringCfg := ` 11 | prometheus: 12 | wal_directory: /tmp/agent 13 | integrations: 14 | postgres_exporter: 15 | enabled: true 16 | data_source_names: ["secret_password_in_uri","secret_password_in_uri_2"] 17 | ` 18 | config.CheckSecret(t, stringCfg, "secret_password_in_uri") 19 | config.CheckSecret(t, stringCfg, "secret_password_in_uri_2") 20 | } 21 | -------------------------------------------------------------------------------- /static/integrations/redis_exporter/testdata/password_map_file.json: -------------------------------------------------------------------------------- 1 | {"redis://localhost:6379": "sample_password"} 2 | -------------------------------------------------------------------------------- /static/integrations/snmp_exporter/common/snmp.yml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/integrations/snmp_exporter/common/snmp.yml.gz -------------------------------------------------------------------------------- /static/integrations/v2/apache_http/apache_http_test.go: -------------------------------------------------------------------------------- 1 | package apache_http 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | integrations_v2 "github.com/grafana/agent/static/integrations/v2" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestApacheHttp_Identifier(t *testing.T) { 12 | globals := integrations_v2.Globals{} 13 | hosts := []string{"localhost", "localhost:8080", "10.0.0.1", "10.0.0.1:8080"} 14 | 15 | for _, host := range hosts { 16 | cfg := Config{ 17 | ApacheAddr: fmt.Sprintf("http://%s/server-status?auto", host), 18 | } 19 | 20 | id, err := cfg.Identifier(globals) 21 | require.NoError(t, err) 22 | require.Equal(t, id, host) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /static/integrations/v2/eventhandler/testdata/eventhandler.cache: -------------------------------------------------------------------------------- 1 | {"ts":"2022-01-26T13:39:40-05:00","resourceVersion":{"58588":{}}} -------------------------------------------------------------------------------- /static/metrics/cluster/config_test.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | "gopkg.in/yaml.v2" 8 | ) 9 | 10 | func TestConfig_MarshalYAMLOmitEmptyFields(t *testing.T) { 11 | var cfg Config 12 | yml, err := yaml.Marshal(&cfg) 13 | require.NoError(t, err) 14 | require.Equal(t, "{}\n", string(yml)) 15 | } 16 | 17 | func TestConfig_MarshalYAMLOmitDefaultConfigFields(t *testing.T) { 18 | cfg := DefaultConfig 19 | yml, err := yaml.Marshal(&cfg) 20 | require.NoError(t, err) 21 | require.NotContains(t, string(yml), "kvstore") 22 | require.NotContains(t, string(yml), "lifecycler") 23 | } 24 | -------------------------------------------------------------------------------- /static/operator/apis/monitoring/doc.go: -------------------------------------------------------------------------------- 1 | // File needed for gen-crd-api-reference-docs tool 2 | // to generate CRD docs reference. 3 | 4 | package monitoring 5 | -------------------------------------------------------------------------------- /static/operator/apis/monitoring/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // File needed for gen-crd-api-reference-docs tool 2 | // to generate CRD docs reference. 3 | 4 | // +kubebuilder:object:generate=true 5 | // +groupName=monitoring.grafana.com 6 | 7 | package v1alpha1 8 | -------------------------------------------------------------------------------- /static/operator/config/templates/component/logs/relabel_config.libsonnet: -------------------------------------------------------------------------------- 1 | local optionals = import 'ext/optionals.libsonnet'; 2 | 3 | // @param {RelabelConfig} cfg 4 | function(cfg) { 5 | source_labels: optionals.array(cfg.SourceLabels), 6 | separator: optionals.string(cfg.Separator), 7 | regex: optionals.string(cfg.Regex), 8 | modulus: optionals.number(cfg.Modulus), 9 | target_label: optionals.string(cfg.TargetLabel), 10 | replacement: optionals.string(cfg.Replacement), 11 | action: optionals.string(cfg.Action), 12 | } 13 | -------------------------------------------------------------------------------- /static/operator/config/templates/component/metrics/relabel_config.libsonnet: -------------------------------------------------------------------------------- 1 | local optionals = import 'ext/optionals.libsonnet'; 2 | 3 | // @param {RelabelConfig} cfg 4 | function(cfg) { 5 | source_labels: optionals.array(cfg.SourceLabels), 6 | separator: optionals.string(cfg.Separator), 7 | regex: optionals.string(cfg.Regex), 8 | modulus: optionals.number(cfg.Modulus), 9 | target_label: optionals.string(cfg.TargetLabel), 10 | replacement: optionals.string(cfg.Replacement), 11 | action: optionals.string(cfg.Action), 12 | } 13 | -------------------------------------------------------------------------------- /static/operator/config/templates/component/metrics/safe_tls_config.libsonnet: -------------------------------------------------------------------------------- 1 | local optionals = import 'ext/optionals.libsonnet'; 2 | local secrets = import 'ext/secrets.libsonnet'; 3 | 4 | // @param {string} namespace 5 | // @param {SafeTLSConfig} config 6 | function(namespace, config) { 7 | ca_file: secrets.pathForSelector(namespace, config.CA), 8 | cert_file: secrets.pathForSelector(namespace, config.Cert), 9 | key_file: secrets.pathForSecret(namespace, config.KeySecret), 10 | 11 | server_name: optionals.string(config.ServerName), 12 | insecure_skip_verify: optionals.bool(config.InsecureSkipVerify), 13 | } 14 | -------------------------------------------------------------------------------- /static/operator/config/templates/ext/marshal.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | // YAML marshals object to YAML. 3 | YAML(object):: std.native('marshalYAML')(object), 4 | 5 | // fromYAML unmarshals YAML text into an object. 6 | fromYAML(text):: std.native('unmarshalYAML')(text), 7 | 8 | // intoStages unmarshals YAML text into []*PipelineStageSpec. 9 | // This is required because the "match" stage from Promtail is 10 | // recursive and you can't define recursive types in CRDs. 11 | intoStages(text):: std.native('intoStages')(text), 12 | } 13 | -------------------------------------------------------------------------------- /static/operator/config/templates/integrations.libsonnet: -------------------------------------------------------------------------------- 1 | // Generates an individual integration. 2 | // 3 | // @param {Integration} integration 4 | function(integration) 5 | // integration.Spec.Config.Raw is a base64 JSON string holding the raw config 6 | // for the integration. 7 | local raw = integration.Spec.Config.Raw; 8 | if raw == null || std.length(raw) == 0 then {} 9 | else std.parseJson(std.base64Decode(raw)) 10 | -------------------------------------------------------------------------------- /static/operator/config/utils_test.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | "gopkg.in/yaml.v2" 8 | ) 9 | 10 | func Test_unmarshalYAML(t *testing.T) { 11 | in := ` 12 | - a: 5 13 | ` 14 | 15 | out, err := unmarshalYAML([]interface{}{in}) 16 | require.NoError(t, err) 17 | 18 | bb, err := yaml.Marshal(out) 19 | require.NoError(t, err) 20 | 21 | require.YAMLEq(t, in, string(bb)) 22 | } 23 | -------------------------------------------------------------------------------- /static/operator/defaults.go: -------------------------------------------------------------------------------- 1 | package operator 2 | 3 | // Supported versions of the Grafana Agent. 4 | var ( 5 | DefaultAgentVersion = "v0.44.2" 6 | DefaultAgentBaseImage = "grafana/agent" 7 | DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion 8 | ) 9 | 10 | // Defaults for Prometheus Config Reloader. 11 | var ( 12 | DefaultConfigReloaderVersion = "v0.67.1" 13 | DefaultConfigReloaderBaseImage = "quay.io/prometheus-operator/prometheus-config-reloader" 14 | DefaultConfigReloaderImage = DefaultConfigReloaderBaseImage + ":" + DefaultConfigReloaderVersion 15 | ) 16 | -------------------------------------------------------------------------------- /static/operator/defaults.go.t: -------------------------------------------------------------------------------- 1 | package operator 2 | 3 | // Supported versions of the Grafana Agent. 4 | var ( 5 | DefaultAgentVersion = "$AGENT_VERSION" 6 | DefaultAgentBaseImage = "grafana/agent" 7 | DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion 8 | ) 9 | 10 | // Defaults for Prometheus Config Reloader. 11 | var ( 12 | DefaultConfigReloaderVersion = "v0.67.1" 13 | DefaultConfigReloaderBaseImage = "quay.io/prometheus-operator/prometheus-config-reloader" 14 | DefaultConfigReloaderImage = DefaultConfigReloaderBaseImage + ":" + DefaultConfigReloaderVersion 15 | ) 16 | -------------------------------------------------------------------------------- /static/server/config_test.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | "gopkg.in/yaml.v2" 8 | ) 9 | 10 | func TestConfig_OmitEmptyFields(t *testing.T) { 11 | var cfg Config 12 | yml, err := yaml.Marshal(&cfg) 13 | require.NoError(t, err) 14 | require.Equal(t, "{}\n", string(yml)) 15 | } 16 | -------------------------------------------------------------------------------- /static/server/testdata/windows/CLIENT_CA_CERT.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/server/testdata/windows/CLIENT_CA_CERT.cer -------------------------------------------------------------------------------- /static/server/testdata/windows/README.md: -------------------------------------------------------------------------------- 1 | The files here are for usage with windows TLS. They need to be installed to the Users certificate store in the `My` location if using the included agent configuration. 2 | 3 | Running ` .\curl.exe -v -GET --key .\client_key_unencrypted.key --cert .\client_cert.crt --insecure https://localhost:12345/metrics` will let you see the correct metrics. NOTE: You will need to likely download [curl](https://curl.se/windows/dl-7.82.0_2/curl-7.82.0_2-win64-mingw.zip) compiled explicitly with windows crypto support. -------------------------------------------------------------------------------- /static/server/testdata/windows/client_cert.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grafana/agent/630bf64fb014fd9f620f0dfb0b5ac56291748db3/static/server/testdata/windows/client_cert.pfx -------------------------------------------------------------------------------- /static/server/tls_certstore_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package server 4 | 5 | import "fmt" 6 | 7 | func (l *tlsListener) applyWindowsCertificateStore(_ TLSConfig) error { 8 | return fmt.Errorf("cannot use Windows certificate store on non-Windows platforms") 9 | } 10 | 11 | type WinCertStoreHandler struct { 12 | } 13 | 14 | func (w WinCertStoreHandler) Run() {} 15 | 16 | func (w WinCertStoreHandler) Stop() {} 17 | -------------------------------------------------------------------------------- /static/traces/contextkeys/keys.go: -------------------------------------------------------------------------------- 1 | package contextkeys 2 | 3 | type key int 4 | 5 | const ( 6 | // Logs is used to pass *logs.Logs through the context 7 | Logs key = iota 8 | 9 | // Metrics is used to pass instance.Manager through the context 10 | Metrics 11 | ) 12 | -------------------------------------------------------------------------------- /static/traces/pushreceiver/receiver.go: -------------------------------------------------------------------------------- 1 | package pushreceiver 2 | 3 | import ( 4 | "context" 5 | 6 | "go.opentelemetry.io/collector/component" 7 | otelreceiver "go.opentelemetry.io/collector/receiver" 8 | ) 9 | 10 | type receiver struct{} 11 | 12 | func (r *receiver) Start(_ context.Context, _ component.Host) error { 13 | return nil 14 | } 15 | 16 | func (r *receiver) Shutdown(_ context.Context) error { 17 | return nil 18 | } 19 | 20 | func newPushReceiver() (otelreceiver.Traces, error) { 21 | return &receiver{}, nil 22 | } 23 | -------------------------------------------------------------------------------- /tools/gen-versioned-files/agent-version.txt: -------------------------------------------------------------------------------- 1 | v0.44.2 -------------------------------------------------------------------------------- /tools/image-tag: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o pipefail 4 | 5 | if [ ! -z "${RELEASE_TAG}" ]; then 6 | echo ${RELEASE_TAG} 7 | exit 0 8 | fi 9 | 10 | set -o nounset 11 | 12 | WIP=$(git diff --quiet || echo '-WIP') 13 | BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g') 14 | 15 | # When 7 chars are not enough to be unique, git automatically uses more. 16 | # We are forcing to 7 here, as we are doing for grafana/grafana as well. 17 | SHA=$(git rev-parse --short=7 HEAD | head -c7) 18 | 19 | # If this is a tag, use it, otherwise use - 20 | TAG=$(git describe --exact-match 2> /dev/null || echo "${BRANCH}-${SHA}") 21 | echo ${TAG}${WIP} 22 | --------------------------------------------------------------------------------