├── CODEOWNERS ├── example ├── k3d │ ├── vendor │ │ ├── 1.14 │ │ ├── grafana-agent │ │ ├── grafonnet │ │ ├── mixin-utils │ │ ├── cortex-mixin │ │ ├── grafana-agent-mixin │ │ ├── ksonnet-util │ │ ├── grafana-builder │ │ └── github.com │ │ │ ├── grafana │ │ │ ├── cortex-jsonnet │ │ │ │ └── cortex-mixin │ │ │ │ │ ├── alerts.jsonnet │ │ │ │ │ ├── recording_rules.jsonnet │ │ │ │ │ ├── mixin.libsonnet │ │ │ │ │ ├── dashboards.jsonnet │ │ │ │ │ ├── alerts │ │ │ │ │ └── alert-utils.libsonnet │ │ │ │ │ ├── alerts.libsonnet │ │ │ │ │ ├── jsonnetfile.json │ │ │ │ │ └── jsonnetfile.lock.json │ │ │ └── grafonnet-lib │ │ │ │ └── grafonnet │ │ │ │ ├── loki.libsonnet │ │ │ │ ├── sql.libsonnet │ │ │ │ ├── link.libsonnet │ │ │ │ ├── text.libsonnet │ │ │ │ ├── timepicker.libsonnet │ │ │ │ ├── prometheus.libsonnet │ │ │ │ ├── pluginlist.libsonnet │ │ │ │ └── alertlist.libsonnet │ │ │ └── jsonnet-libs │ │ │ └── k8s-alpha │ │ │ └── 1.14 │ │ │ ├── main.libsonnet │ │ │ └── _gen │ │ │ ├── core │ │ │ ├── main.libsonnet │ │ │ └── v1 │ │ │ │ ├── daemonEndpoint.libsonnet │ │ │ │ ├── objectFieldSelector.libsonnet │ │ │ │ ├── podReadinessGate.libsonnet │ │ │ │ ├── namespaceStatus.libsonnet │ │ │ │ ├── podDNSConfigOption.libsonnet │ │ │ │ ├── sysctl.libsonnet │ │ │ │ ├── httpHeader.libsonnet │ │ │ │ ├── localObjectReference.libsonnet │ │ │ │ ├── containerStateRunning.libsonnet │ │ │ │ ├── nodeAddress.libsonnet │ │ │ │ ├── eventSource.libsonnet │ │ │ │ ├── nodeDaemonEndpoints.libsonnet │ │ │ │ ├── attachedVolume.libsonnet │ │ │ │ ├── clientIPConfig.libsonnet │ │ │ │ ├── containerStateWaiting.libsonnet │ │ │ │ ├── volumeDevice.libsonnet │ │ │ │ ├── secretReference.libsonnet │ │ │ │ ├── photonPersistentDiskVolumeSource.libsonnet │ │ │ │ ├── tcpSocketAction.libsonnet │ │ │ │ ├── configMapKeySelector.libsonnet │ │ │ │ ├── secretEnvSource.libsonnet │ │ │ │ ├── loadBalancerIngress.libsonnet │ │ │ │ ├── sessionAffinityConfig.libsonnet │ │ │ │ ├── configMapEnvSource.libsonnet │ │ │ │ ├── limitRangeSpec.libsonnet │ │ │ │ ├── endpointPort.libsonnet │ │ │ │ ├── hostPathVolumeSource.libsonnet │ │ │ │ └── componentCondition.libsonnet │ │ │ ├── events │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── policy │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── allowedCSIDriver.libsonnet │ │ │ │ ├── allowedFlexVolume.libsonnet │ │ │ │ ├── idRange.libsonnet │ │ │ │ └── hostPortRange.libsonnet │ │ │ ├── extensions │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── rollbackConfig.libsonnet │ │ │ │ ├── scaleSpec.libsonnet │ │ │ │ ├── allowedCSIDriver.libsonnet │ │ │ │ ├── allowedFlexVolume.libsonnet │ │ │ │ ├── idRange.libsonnet │ │ │ │ ├── rollingUpdateDaemonSet.libsonnet │ │ │ │ └── hostPortRange.libsonnet │ │ │ ├── scheduling │ │ │ ├── v1 │ │ │ │ └── main.libsonnet │ │ │ ├── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── v1alpha1 │ │ │ │ └── main.libsonnet │ │ │ └── main.libsonnet │ │ │ ├── settings │ │ │ ├── main.libsonnet │ │ │ └── v1alpha1 │ │ │ │ └── main.libsonnet │ │ │ ├── certificates │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── node │ │ │ ├── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── main.libsonnet │ │ │ └── v1alpha1 │ │ │ │ └── main.libsonnet │ │ │ ├── auditregistration │ │ │ ├── main.libsonnet │ │ │ └── v1alpha1 │ │ │ │ ├── main.libsonnet │ │ │ │ ├── webhookThrottleConfig.libsonnet │ │ │ │ └── serviceReference.libsonnet │ │ │ ├── admissionregistration │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── main.libsonnet │ │ │ │ └── serviceReference.libsonnet │ │ │ ├── coordination │ │ │ ├── v1 │ │ │ │ └── main.libsonnet │ │ │ ├── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── networking │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ │ └── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── authorization │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ │ ├── selfSubjectRulesReviewSpec.libsonnet │ │ │ │ └── nonResourceAttributes.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── selfSubjectRulesReviewSpec.libsonnet │ │ │ │ └── nonResourceAttributes.libsonnet │ │ │ ├── authentication │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ │ └── main.libsonnet │ │ │ └── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ ├── apps │ │ │ ├── main.libsonnet │ │ │ ├── v1beta1 │ │ │ │ ├── rollbackConfig.libsonnet │ │ │ │ ├── scaleSpec.libsonnet │ │ │ │ └── rollingUpdateStatefulSetStrategy.libsonnet │ │ │ ├── v1beta2 │ │ │ │ ├── scaleSpec.libsonnet │ │ │ │ ├── rollingUpdateStatefulSetStrategy.libsonnet │ │ │ │ └── rollingUpdateDaemonSet.libsonnet │ │ │ └── v1 │ │ │ │ ├── rollingUpdateStatefulSetStrategy.libsonnet │ │ │ │ └── rollingUpdateDaemonSet.libsonnet │ │ │ ├── batch │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ │ └── main.libsonnet │ │ │ ├── v1beta1 │ │ │ │ └── main.libsonnet │ │ │ └── v2alpha1 │ │ │ │ └── main.libsonnet │ │ │ ├── rbac │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ │ ├── main.libsonnet │ │ │ │ └── roleRef.libsonnet │ │ │ ├── v1alpha1 │ │ │ │ ├── main.libsonnet │ │ │ │ └── roleRef.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── main.libsonnet │ │ │ │ └── roleRef.libsonnet │ │ │ ├── storage │ │ │ ├── main.libsonnet │ │ │ ├── v1alpha1 │ │ │ │ ├── main.libsonnet │ │ │ │ ├── volumeAttachmentSource.libsonnet │ │ │ │ └── volumeError.libsonnet │ │ │ ├── v1 │ │ │ │ ├── main.libsonnet │ │ │ │ ├── volumeAttachmentSource.libsonnet │ │ │ │ └── volumeError.libsonnet │ │ │ └── v1beta1 │ │ │ │ ├── volumeAttachmentSource.libsonnet │ │ │ │ ├── main.libsonnet │ │ │ │ └── volumeError.libsonnet │ │ │ └── autoscaling │ │ │ ├── main.libsonnet │ │ │ ├── v1 │ │ │ ├── scaleSpec.libsonnet │ │ │ ├── main.libsonnet │ │ │ └── crossVersionObjectReference.libsonnet │ │ │ ├── v2beta1 │ │ │ └── crossVersionObjectReference.libsonnet │ │ │ └── v2beta2 │ │ │ └── crossVersionObjectReference.libsonnet │ ├── assets │ │ ├── order.png │ │ ├── alerts.png │ │ ├── alert_firing.png │ │ ├── pending_alert.png │ │ ├── console_failure.png │ │ ├── trigger_change.png │ │ └── order.uml │ ├── lib │ │ ├── k.libsonnet │ │ ├── collector │ │ │ └── collector-config.libsonnet │ │ └── grafana │ │ │ └── datasource.libsonnet │ ├── smoke │ │ └── spec.json │ ├── environment │ │ └── spec.json │ └── scripts │ │ └── create.bash └── docker-compose │ ├── vendor │ ├── grafonnet │ ├── grafana-agent-mixin │ ├── grafana-builder │ └── github.com │ │ └── grafana │ │ └── grafonnet-lib │ │ └── grafonnet │ │ ├── sql.libsonnet │ │ ├── link.libsonnet │ │ ├── text.libsonnet │ │ ├── timepicker.libsonnet │ │ ├── prometheus.libsonnet │ │ ├── influxdb.libsonnet │ │ ├── graphite.libsonnet │ │ └── row.libsonnet │ ├── grafana │ ├── config │ │ └── grafana.ini │ ├── dashboards-provisioning │ │ └── dashboards.yaml │ └── dashboards │ │ └── template.jsonnet │ ├── otel-collector │ └── config.yaml │ ├── jsonnetfile.json │ └── agent │ └── instance-configs │ ├── avalanche-1.yaml │ ├── avalanche-2.yaml │ ├── avalanche-3.yaml │ ├── avalanche-4.yaml │ ├── avalanche-5.yaml │ └── agents.yaml ├── production ├── kubernetes │ └── build │ │ ├── lib │ │ ├── version.libsonnet │ │ └── k.libsonnet │ │ ├── vendor │ │ ├── grafana-agent │ │ ├── 1.21 │ │ ├── ksonnet-util │ │ └── github.com │ │ │ └── jsonnet-libs │ │ │ └── k8s-libsonnet │ │ │ └── 1.21 │ │ │ ├── _gen │ │ │ ├── apps │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1 │ │ │ │ │ └── rollingUpdateStatefulSetStrategy.libsonnet │ │ │ ├── core │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1 │ │ │ │ │ ├── daemonEndpoint.libsonnet │ │ │ │ │ ├── objectFieldSelector.libsonnet │ │ │ │ │ ├── podIP.libsonnet │ │ │ │ │ ├── podReadinessGate.libsonnet │ │ │ │ │ ├── podDNSConfigOption.libsonnet │ │ │ │ │ ├── sysctl.libsonnet │ │ │ │ │ ├── httpHeader.libsonnet │ │ │ │ │ ├── localObjectReference.libsonnet │ │ │ │ │ ├── containerStateRunning.libsonnet │ │ │ │ │ ├── nodeAddress.libsonnet │ │ │ │ │ ├── eventSource.libsonnet │ │ │ │ │ ├── nodeDaemonEndpoints.libsonnet │ │ │ │ │ ├── attachedVolume.libsonnet │ │ │ │ │ ├── clientIPConfig.libsonnet │ │ │ │ │ ├── containerStateWaiting.libsonnet │ │ │ │ │ ├── volumeDevice.libsonnet │ │ │ │ │ ├── secretReference.libsonnet │ │ │ │ │ ├── eventSeries.libsonnet │ │ │ │ │ ├── photonPersistentDiskVolumeSource.libsonnet │ │ │ │ │ ├── tcpSocketAction.libsonnet │ │ │ │ │ ├── configMapKeySelector.libsonnet │ │ │ │ │ ├── secretEnvSource.libsonnet │ │ │ │ │ ├── configMapEnvSource.libsonnet │ │ │ │ │ └── sessionAffinityConfig.libsonnet │ │ │ ├── extensions │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── flowcontrol │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ ├── userSubject.libsonnet │ │ │ │ │ ├── flowDistinguisherMethod.libsonnet │ │ │ │ │ ├── priorityLevelConfigurationReference.libsonnet │ │ │ │ │ ├── groupSubject.libsonnet │ │ │ │ │ └── serviceAccountSubject.libsonnet │ │ │ ├── scheduling │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ ├── v1alpha1 │ │ │ │ │ └── main.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── main.libsonnet │ │ │ ├── apiserverinternal │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── storageVersionSpec.libsonnet │ │ │ │ │ └── main.libsonnet │ │ │ ├── batch │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── events │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── eventSeries.libsonnet │ │ │ ├── policy │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ ├── allowedCSIDriver.libsonnet │ │ │ │ │ ├── allowedFlexVolume.libsonnet │ │ │ │ │ ├── idRange.libsonnet │ │ │ │ │ └── hostPortRange.libsonnet │ │ │ ├── coordination │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ ├── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── discovery │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ ├── forZone.libsonnet │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ ├── forZone.libsonnet │ │ │ │ │ └── main.libsonnet │ │ │ ├── networking │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── serviceBackendPort.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── authorization │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ ├── selfSubjectRulesReviewSpec.libsonnet │ │ │ │ │ └── nonResourceAttributes.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ ├── selfSubjectRulesReviewSpec.libsonnet │ │ │ │ │ └── nonResourceAttributes.libsonnet │ │ │ ├── certificates │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── apiregistration │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── authentication │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ ├── boundObjectReference.libsonnet │ │ │ │ │ └── tokenRequestStatus.libsonnet │ │ │ ├── admissionregistration │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ └── main.libsonnet │ │ │ │ └── v1beta1 │ │ │ │ │ └── main.libsonnet │ │ │ ├── node │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── overhead.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── overhead.libsonnet │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── overhead.libsonnet │ │ │ ├── rbac │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── roleRef.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── roleRef.libsonnet │ │ │ │ └── v1alpha1 │ │ │ │ │ ├── main.libsonnet │ │ │ │ │ └── roleRef.libsonnet │ │ │ ├── storage │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1alpha1 │ │ │ │ │ └── main.libsonnet │ │ │ │ ├── v1beta1 │ │ │ │ │ └── volumeNodeResources.libsonnet │ │ │ │ └── v1 │ │ │ │ │ └── volumeNodeResources.libsonnet │ │ │ └── autoscaling │ │ │ │ ├── main.libsonnet │ │ │ │ ├── v1 │ │ │ │ ├── scaleSpec.libsonnet │ │ │ │ ├── main.libsonnet │ │ │ │ └── crossVersionObjectReference.libsonnet │ │ │ │ ├── v2beta1 │ │ │ │ └── crossVersionObjectReference.libsonnet │ │ │ │ └── v2beta2 │ │ │ │ └── crossVersionObjectReference.libsonnet │ │ │ ├── main.libsonnet │ │ │ └── _custom │ │ │ └── batch.libsonnet │ │ ├── templates │ │ ├── bare │ │ │ ├── spec.json │ │ │ └── main.jsonnet │ │ ├── base │ │ │ ├── spec.json │ │ │ └── main.jsonnet │ │ ├── loki │ │ │ ├── spec.json │ │ │ └── main.jsonnet │ │ ├── traces │ │ │ └── spec.json │ │ └── base-sigv4 │ │ │ └── spec.json │ │ ├── build.sh │ │ └── jsonnetfile.json ├── tanka │ └── grafana-agent │ │ ├── v1 │ │ ├── lib │ │ │ └── scraping_service.libsonnet │ │ └── internal │ │ │ └── kubernetes_logs.libsonnet │ │ ├── jsonnetfile.json │ │ └── v2 │ │ └── internal │ │ └── controllers │ │ ├── daemonset.libsonnet │ │ └── deployment.libsonnet └── grafana-agent-mixin │ ├── mixin.libsonnet │ └── jsonnetfile.json ├── packaging ├── windows │ ├── logo.ico │ └── Dockerfile ├── deb │ ├── control │ │ └── prerm │ └── grafana-agent.service ├── environment-file └── rpm │ ├── control │ └── prerm │ └── grafana-agent.service ├── docs └── assets │ └── logo_and_name.png ├── tools ├── release ├── image-tag └── seego │ └── Dockerfile ├── .github ├── pull_request_template.md ├── workflows │ ├── markdown.links.config.json │ ├── scripts.yml │ ├── depcheck.yml │ ├── check_docs.yml │ └── test.yml └── stale.yml ├── pkg ├── traces │ ├── contextkeys │ │ └── keys.go │ └── noopreceiver │ │ └── receiver.go ├── util │ ├── untab.go │ ├── compare_yaml.go │ └── test_logger.go ├── agentctl │ └── testdata │ │ ├── agent-1.yaml │ │ ├── agent-2.yaml │ │ └── agent-3.yaml ├── operator │ ├── config │ │ ├── utils_test.go │ │ └── templates │ │ │ ├── component │ │ │ └── metrics │ │ │ │ ├── relabel_config.libsonnet │ │ │ │ └── safe_tls_config.libsonnet │ │ │ └── ext │ │ │ └── marshal.libsonnet │ └── defaults.go ├── build │ └── build.go ├── agentproto │ ├── func.go │ └── agent.proto ├── metrics │ └── instance │ │ ├── global.go │ │ └── configstore │ │ └── errors.go └── integrations │ └── windows_exporter │ └── windows_exporter_windows.go ├── .drone └── README.md ├── ADOPTERS.md ├── .gitignore ├── cmd ├── agent │ ├── service.go │ └── agent-local-config.yaml ├── grafana-agent-crow │ ├── Dockerfile │ └── README.md └── agent-operator │ ├── Dockerfile │ └── Dockerfile.buildx └── MAINTAINERS.md /CODEOWNERS: -------------------------------------------------------------------------------- 1 | /pkg/traces/ @joe-elliott @mapno 2 | -------------------------------------------------------------------------------- /example/k3d/vendor/1.14: -------------------------------------------------------------------------------- 1 | github.com/jsonnet-libs/k8s-alpha/1.14 -------------------------------------------------------------------------------- /example/k3d/vendor/grafana-agent: -------------------------------------------------------------------------------- 1 | ../../../production/tanka/grafana-agent -------------------------------------------------------------------------------- /example/k3d/vendor/grafonnet: -------------------------------------------------------------------------------- 1 | github.com/grafana/grafonnet-lib/grafonnet -------------------------------------------------------------------------------- /example/k3d/vendor/mixin-utils: -------------------------------------------------------------------------------- 1 | github.com/grafana/jsonnet-libs/mixin-utils -------------------------------------------------------------------------------- /example/k3d/vendor/cortex-mixin: -------------------------------------------------------------------------------- 1 | github.com/grafana/cortex-jsonnet/cortex-mixin -------------------------------------------------------------------------------- /example/k3d/vendor/grafana-agent-mixin: -------------------------------------------------------------------------------- 1 | ../../../production/grafana-agent-mixin -------------------------------------------------------------------------------- /example/k3d/vendor/ksonnet-util: -------------------------------------------------------------------------------- 1 | github.com/grafana/jsonnet-libs/ksonnet-util -------------------------------------------------------------------------------- /production/kubernetes/build/lib/version.libsonnet: -------------------------------------------------------------------------------- 1 | 'grafana/agent:v0.19.0' 2 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/grafana-agent: -------------------------------------------------------------------------------- 1 | ../../../tanka/grafana-agent -------------------------------------------------------------------------------- /example/docker-compose/vendor/grafonnet: -------------------------------------------------------------------------------- 1 | github.com/grafana/grafonnet-lib/grafonnet -------------------------------------------------------------------------------- /example/k3d/vendor/grafana-builder: -------------------------------------------------------------------------------- 1 | github.com/grafana/jsonnet-libs/grafana-builder -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/1.21: -------------------------------------------------------------------------------- 1 | github.com/jsonnet-libs/k8s-libsonnet/1.21 -------------------------------------------------------------------------------- /example/docker-compose/vendor/grafana-agent-mixin: -------------------------------------------------------------------------------- 1 | ../../../production/grafana-agent-mixin -------------------------------------------------------------------------------- /example/docker-compose/vendor/grafana-builder: -------------------------------------------------------------------------------- 1 | github.com/grafana/jsonnet-libs/grafana-builder -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/ksonnet-util: -------------------------------------------------------------------------------- 1 | github.com/grafana/jsonnet-libs/ksonnet-util -------------------------------------------------------------------------------- /packaging/windows/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/packaging/windows/logo.ico -------------------------------------------------------------------------------- /example/k3d/assets/order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/order.png -------------------------------------------------------------------------------- /docs/assets/logo_and_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/docs/assets/logo_and_name.png -------------------------------------------------------------------------------- /example/k3d/assets/alerts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/alerts.png -------------------------------------------------------------------------------- /production/kubernetes/build/lib/k.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'github.com/jsonnet-libs/k8s-libsonnet/1.21/main.libsonnet') 2 | -------------------------------------------------------------------------------- /example/k3d/assets/alert_firing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/alert_firing.png -------------------------------------------------------------------------------- /example/k3d/assets/pending_alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/pending_alert.png -------------------------------------------------------------------------------- /example/k3d/assets/console_failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/console_failure.png -------------------------------------------------------------------------------- /example/k3d/assets/trigger_change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephwoodward/agent/main/example/k3d/assets/trigger_change.png -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/alerts.jsonnet: -------------------------------------------------------------------------------- 1 | std.manifestYamlDoc((import 'mixin.libsonnet').prometheusAlerts) 2 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/recording_rules.jsonnet: -------------------------------------------------------------------------------- 1 | std.manifestYamlDoc((import 'mixin.libsonnet').prometheusRules) 2 | -------------------------------------------------------------------------------- /production/tanka/grafana-agent/v1/lib/scraping_service.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | // TODO(rfratto): port scraping service code and expose as newScrapingService 3 | // here. 4 | } 5 | -------------------------------------------------------------------------------- /example/k3d/lib/k.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'github.com/jsonnet-libs/k8s-alpha/1.14/main.libsonnet') 2 | + (import 'github.com/jsonnet-libs/k8s-alpha/1.14/extensions/kausal-shim.libsonnet') 3 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/main.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'gen.libsonnet') + (import '_custom/apps.libsonnet') + (import '_custom/core.libsonnet') + (import '_custom/mapContainers.libsonnet') -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'config.libsonnet') + 2 | (import 'dashboards.libsonnet') + 3 | (import 'alerts.libsonnet') + 4 | (import 'recording_rules.libsonnet') 5 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='core', url='', help=''), 4 | v1: (import 'v1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /packaging/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 -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/events/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='events', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/policy/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='policy', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /production/tanka/grafana-agent/v1/internal/kubernetes_logs.libsonnet: -------------------------------------------------------------------------------- 1 | local k8s_v2 = import '../../v2/internal/helpers/k8s.libsonnet'; 2 | 3 | { 4 | newKubernetesLogsCollector():: { 5 | scrape_configs: k8s_v2.logs(), 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='extensions', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/scheduling/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/settings/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='settings', url='', help=''), 4 | v1alpha1: (import 'v1alpha1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/certificates/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='certificates', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/node/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | runtimeClass: (import 'runtimeClass.libsonnet') 5 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apps/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='apps', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='core', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/scheduling/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet') 5 | } -------------------------------------------------------------------------------- /tools/release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ghr \ 3 | -t "${GITHUB_TOKEN}" \ 4 | -u "grafana" \ 5 | -r "agent" \ 6 | -c "${GITHUB_SHA}" \ 7 | -b="$(cat ./tools/release-note.md | envsubst)" \ 8 | -delete -draft \ 9 | "${RELEASE_TAG}" ./dist/ 10 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | #### PR Description 2 | 3 | #### Which issue(s) this PR fixes 4 | 5 | #### Notes to the Reviewer 6 | 7 | #### PR Checklist 8 | 9 | - [ ] CHANGELOG updated 10 | - [ ] Documentation added 11 | - [ ] Tests updated 12 | -------------------------------------------------------------------------------- /.github/workflows/markdown.links.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [ 3 | { 4 | "pattern": "^http://prometheus.k3d.localhost:30080" 5 | }, 6 | { 7 | "pattern": "^http://prometheus.k3d.localhost:50080" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/auditregistration/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='auditregistration', url='', help=''), 4 | v1alpha1: (import 'v1alpha1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/scheduling/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/admissionregistration/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='admissionregistration', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet') 5 | } -------------------------------------------------------------------------------- /example/docker-compose/otel-collector/config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | otlp: 3 | protocols: 4 | grpc: 5 | exporters: 6 | logging: 7 | loglevel: info 8 | service: 9 | pipelines: 10 | traces: 11 | receivers: [otlp] 12 | exporters: [logging] -------------------------------------------------------------------------------- /example/k3d/smoke/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "default" 6 | }, 7 | "spec": { 8 | "apiServer": "https://0.0.0.0:50443", 9 | "namespace": "default" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/dashboards.jsonnet: -------------------------------------------------------------------------------- 1 | local mixin = import 'mixin.libsonnet'; 2 | 3 | { 4 | [name]: std.manifestJsonEx(mixin.grafanaDashboards[name], ' ') 5 | for name in std.objectFields(mixin.grafanaDashboards) 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/bare/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "template" 6 | }, 7 | "spec": { 8 | "apiServer": "", 9 | "namespace": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/base/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "template" 6 | }, 7 | "spec": { 8 | "apiServer": "", 9 | "namespace": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/loki/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "template" 6 | }, 7 | "spec": { 8 | "apiServer": "", 9 | "namespace": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/traces/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "template" 6 | }, 7 | "spec": { 8 | "apiServer": "", 9 | "namespace": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/extensions/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='extensions', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/loki.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name loki.target 4 | */ 5 | target( 6 | expr, 7 | hide=null, 8 | ):: { 9 | [if hide != null then 'hide']: hide, 10 | expr: expr, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/base-sigv4/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "template" 6 | }, 7 | "spec": { 8 | "apiServer": "", 9 | "namespace": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='flowcontrol', url='', help=''), 4 | v1beta1: (import 'v1beta1/main.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/scheduling/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /example/k3d/environment/spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "tanka.dev/v1alpha1", 3 | "kind": "Environment", 4 | "metadata": { 5 | "name": "default" 6 | }, 7 | "spec": { 8 | "apiServer": "https://0.0.0.0:50443", 9 | "namespace": "default" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/coordination/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | lease: (import 'lease.libsonnet'), 5 | leaseSpec: (import 'leaseSpec.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/networking/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='networking', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/node/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='node', url='', help=''), 4 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet') 6 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiserverinternal/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='apiserverinternal', url='', help=''), 4 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/scheduling/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/scheduling/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | priorityClass: (import 'priorityClass.libsonnet'), 5 | } 6 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authorization/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='authorization', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/coordination/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='coordination', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/coordination/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | lease: (import 'lease.libsonnet'), 5 | leaseSpec: (import 'leaseSpec.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/events/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | event: (import 'event.libsonnet'), 5 | eventSeries: (import 'eventSeries.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authentication/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='authentication', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet') 6 | } -------------------------------------------------------------------------------- /example/docker-compose/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "source": { 5 | "local": { 6 | "directory": "../production/grafana-agent-mixin" 7 | } 8 | }, 9 | "version": "" 10 | } 11 | ], 12 | "legacyImports": true 13 | } 14 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/batch/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='batch', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /.drone/README.md: -------------------------------------------------------------------------------- 1 | When updating the drone.yml file the file must be re-signed using `make drone`. This is limited to Grafana employees for security reasons. 2 | 3 | Drone environment variables will need to be setup beforehand. 4 | 5 | ``` 6 | export DRONE_SERVER= 7 | export DRONE_TOKEN= 8 | ``` 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/settings/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | podPreset: (import 'podPreset.libsonnet'), 5 | podPresetSpec: (import 'podPresetSpec.libsonnet') 6 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/events/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='events', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/events/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | event: (import 'event.libsonnet'), 5 | eventSeries: (import 'eventSeries.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='policy', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/coordination/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | lease: (import 'lease.libsonnet'), 5 | leaseSpec: (import 'leaseSpec.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/discovery/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='discovery', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/networking/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='networking', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /.github/workflows/scripts.yml: -------------------------------------------------------------------------------- 1 | name: Lint Scripts 2 | on: [pull_request] 3 | jobs: 4 | shellcheck: 5 | name: Shellcheck 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - uses: azohra/shell-linter@latest 10 | with: 11 | path: "packaging,production" 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/node/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | runtimeClass: (import 'runtimeClass.libsonnet'), 5 | runtimeClassSpec: (import 'runtimeClassSpec.libsonnet') 6 | } -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authorization/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='authorization', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/certificates/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='certificates', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/coordination/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='coordination', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/events/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | event: (import 'event.libsonnet'), 5 | eventSeries: (import 'eventSeries.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/sql.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | target( 3 | rawSql, 4 | datasource=null, 5 | format='time_series', 6 | ):: { 7 | [if datasource != null then 'datasource']: datasource, 8 | format: format, 9 | rawSql: rawSql, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiregistration/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='apiregistration', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authentication/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='authentication', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/coordination/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | lease: (import 'lease.libsonnet'), 5 | leaseSpec: (import 'leaseSpec.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='apps', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | v1beta2: (import 'v1beta2/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/batch/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='batch', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | v2alpha1: (import 'v2alpha1/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rbac', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='storage', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='autoscaling', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v2beta1: (import 'v2beta1/main.libsonnet'), 6 | v2beta2: (import 'v2beta2/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/scheduling/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scheduling', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet') 7 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/admissionregistration/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='admissionregistration', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1beta1: (import 'v1beta1/main.libsonnet'), 6 | } 7 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiserverinternal/v1alpha1/storageVersionSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='storageVersionSpec', url='', help='StorageVersionSpec is an empty spec.'), 4 | '#mixin': 'ignore', 5 | mixin: self, 6 | } 7 | -------------------------------------------------------------------------------- /packaging/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 | -------------------------------------------------------------------------------- /production/grafana-agent-mixin/mixin.libsonnet: -------------------------------------------------------------------------------- 1 | local dashboards = import 'dashboards.libsonnet'; 2 | local debugging = import 'debugging.libsonnet'; 3 | 4 | { 5 | grafanaDashboards+:: std.mapWithKey(function(field, obj) obj { 6 | grafanaDashboardFolder: 'Grafana Agent', 7 | }, dashboards.grafanaDashboards + debugging.grafanaDashboards), 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='node', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rbac', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /ADOPTERS.md: -------------------------------------------------------------------------------- 1 | This is the list of organizations, organized alphebetically, 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 | * Cerner Enterprise Hosting 6 | * [Embark Studios](https://www.embark.dev/) 7 | * [Grafana Labs](https://grafana.com) 8 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/storage/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='storage', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/alerts/alert-utils.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | _config:: error 'must provide _config for alerts', 3 | 4 | namespace_matcher(prefix=''):: 5 | if std.length($._config.alert_namespace_matcher) != 0 6 | then '%s namespace=~"%s"' % [prefix, $._config.alert_namespace_matcher] 7 | else '', 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/sql.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name sql.target 4 | */ 5 | target( 6 | rawSql, 7 | datasource=null, 8 | format='time_series', 9 | ):: { 10 | [if datasource != null then 'datasource']: datasource, 11 | format: format, 12 | rawSql: rawSql, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='autoscaling', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v2beta1: (import 'v2beta1/main.libsonnet'), 6 | v2beta2: (import 'v2beta2/main.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | overhead: (import 'overhead.libsonnet'), 5 | runtimeClass: (import 'runtimeClass.libsonnet'), 6 | scheduling: (import 'scheduling.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/scheduling/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scheduling', url='', help=''), 4 | v1: (import 'v1/main.libsonnet'), 5 | v1alpha1: (import 'v1alpha1/main.libsonnet'), 6 | v1beta1: (import 'v1beta1/main.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/batch/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | job: (import 'job.libsonnet'), 5 | jobCondition: (import 'jobCondition.libsonnet'), 6 | jobSpec: (import 'jobSpec.libsonnet'), 7 | jobStatus: (import 'jobStatus.libsonnet') 8 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | overhead: (import 'overhead.libsonnet'), 5 | runtimeClass: (import 'runtimeClass.libsonnet'), 6 | scheduling: (import 'scheduling.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/main.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'gen.libsonnet') + (import '_custom/apps.libsonnet') + (import '_custom/batch.libsonnet') + (import '_custom/core.libsonnet') + (import '_custom/list.libsonnet') + (import '_custom/mapContainers.libsonnet') + (import '_custom/rbac.libsonnet') + (import '_custom/volumeMounts.libsonnet') 2 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.rpmdb/ 2 | /.idea 3 | /.published 4 | /.pkg 5 | /.cache 6 | /.vscode 7 | /vendor 8 | 9 | /cmd/agent/agent 10 | /cmd/agentctl/agentctl 11 | /cmd/agent-operator/agent-operator 12 | /cmd/grafana-agent-crow/grafana-agent-crow 13 | /dist/ 14 | /packaging/windows/LICENSE 15 | /packaging/windows/agent-windows-amd64.exe 16 | 17 | .DS_Store 18 | buildx-v* 19 | cover*.out 20 | .uptodate 21 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/avalanche-1.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | scrape_configs: 3 | - job_name: avalanche-1 4 | static_configs: 5 | - targets: ['avalanche-1:9001'] 6 | labels: 7 | cluster: 'docker_compose' 8 | origin: 'agent' 9 | container: 'avalanche-1' 10 | remote_write: 11 | - url: http://cortex:9009/api/prom/push 12 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/avalanche-2.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | scrape_configs: 3 | - job_name: avalanche-2 4 | static_configs: 5 | - targets: ['avalanche-2:9001'] 6 | labels: 7 | cluster: 'docker_compose' 8 | origin: 'agent' 9 | container: 'avalanche-2' 10 | remote_write: 11 | - url: http://cortex:9009/api/prom/push 12 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/avalanche-3.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | scrape_configs: 3 | - job_name: avalanche-3 4 | static_configs: 5 | - targets: ['avalanche-3:9001'] 6 | labels: 7 | cluster: 'docker_compose' 8 | origin: 'agent' 9 | container: 'avalanche-3' 10 | remote_write: 11 | - url: http://cortex:9009/api/prom/push 12 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/avalanche-4.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | scrape_configs: 3 | - job_name: avalanche-4 4 | static_configs: 5 | - targets: ['avalanche-4:9001'] 6 | labels: 7 | cluster: 'docker_compose' 8 | origin: 'agent' 9 | container: 'avalanche-4' 10 | remote_write: 11 | - url: http://cortex:9009/api/prom/push 12 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/avalanche-5.yaml: -------------------------------------------------------------------------------- 1 | host_filter: false 2 | scrape_configs: 3 | - job_name: avalanche-5 4 | static_configs: 5 | - targets: ['avalanche-5:9001'] 6 | labels: 7 | cluster: 'docker_compose' 8 | origin: 'agent' 9 | container: 'avalanche-5' 10 | remote_write: 11 | - url: http://cortex:9009/api/prom/push 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/alerts.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+:: 3 | (import 'alerts/alerts.libsonnet') + 4 | 5 | (if std.setMember('tsdb', $._config.storage_engine) 6 | then 7 | (import 'alerts/blocks.libsonnet') + 8 | (import 'alerts/compactor.libsonnet') 9 | else {}) + 10 | 11 | { _config:: $._config }, 12 | } 13 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/batch/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | cronJob: (import 'cronJob.libsonnet'), 5 | cronJobSpec: (import 'cronJobSpec.libsonnet'), 6 | cronJobStatus: (import 'cronJobStatus.libsonnet'), 7 | jobTemplateSpec: (import 'jobTemplateSpec.libsonnet') 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/batch/v2alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v2alpha1', url='', help=''), 4 | cronJob: (import 'cronJob.libsonnet'), 5 | cronJobSpec: (import 'cronJobSpec.libsonnet'), 6 | cronJobStatus: (import 'cronJobStatus.libsonnet'), 7 | jobTemplateSpec: (import 'jobTemplateSpec.libsonnet') 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authentication/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | tokenReview: (import 'tokenReview.libsonnet'), 5 | tokenReviewSpec: (import 'tokenReviewSpec.libsonnet'), 6 | tokenReviewStatus: (import 'tokenReviewStatus.libsonnet'), 7 | userInfo: (import 'userInfo.libsonnet') 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authentication/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | tokenReview: (import 'tokenReview.libsonnet'), 5 | tokenReviewSpec: (import 'tokenReviewSpec.libsonnet'), 6 | tokenReviewStatus: (import 'tokenReviewStatus.libsonnet'), 7 | userInfo: (import 'userInfo.libsonnet') 8 | } -------------------------------------------------------------------------------- /production/tanka/grafana-agent/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "ksonnet-util", 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/grafana/jsonnet-libs", 8 | "subdir": "ksonnet-util" 9 | } 10 | }, 11 | "version": "master" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/batch/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | cronJob: (import 'cronJob.libsonnet'), 5 | cronJobSpec: (import 'cronJobSpec.libsonnet'), 6 | cronJobStatus: (import 'cronJobStatus.libsonnet'), 7 | jobTemplateSpec: (import 'jobTemplateSpec.libsonnet'), 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | overhead: (import 'overhead.libsonnet'), 5 | runtimeClass: (import 'runtimeClass.libsonnet'), 6 | runtimeClassSpec: (import 'runtimeClassSpec.libsonnet'), 7 | scheduling: (import 'scheduling.libsonnet'), 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | podDisruptionBudget: (import 'podDisruptionBudget.libsonnet'), 5 | podDisruptionBudgetSpec: (import 'podDisruptionBudgetSpec.libsonnet'), 6 | podDisruptionBudgetStatus: (import 'podDisruptionBudgetStatus.libsonnet'), 7 | } 8 | -------------------------------------------------------------------------------- /.github/workflows/depcheck.yml: -------------------------------------------------------------------------------- 1 | name: Check Dependencies 2 | on: 3 | workflow_dispatch: {} 4 | schedule: 5 | - cron: '0 0 * * *' 6 | jobs: 7 | check: 8 | name: Check 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@v2 13 | 14 | - name: Invoke action 15 | uses: rfratto/depcheck@main 16 | with: 17 | github-token: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authentication/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | tokenReview: (import 'tokenReview.libsonnet'), 5 | tokenReviewSpec: (import 'tokenReviewSpec.libsonnet'), 6 | tokenReviewStatus: (import 'tokenReviewStatus.libsonnet'), 7 | userInfo: (import 'userInfo.libsonnet'), 8 | } 9 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /cmd/agent/service.go: -------------------------------------------------------------------------------- 1 | // +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 servce. On non-Windows platforms, 12 | // this is always a no-op. 13 | func RunService() error { 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /cmd/grafana-agent-crow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16-buster as build 2 | COPY . /src/agent 3 | WORKDIR /src/agent 4 | ARG RELEASE_BUILD=true 5 | ARG IMAGE_TAG 6 | 7 | RUN make clean && make IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false grafana-agent-crow 8 | 9 | FROM debian:buster-slim 10 | COPY --from=build /src/agent/cmd/grafana-agent-crow/grafana-agent-crow /bin/grafana-agent-crow 11 | ENTRYPOINT ["/bin/grafana-agent-crow"] 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/daemonEndpoint.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='daemonEndpoint', url='', help='DaemonEndpoint contains information about a single Daemon endpoint.'), 4 | '#withPort':: d.fn(help='Port number of the given endpoint.', args=[d.arg(name='port', type=d.T.integer)]), 5 | withPort(port): { port: port }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authorization/v1/selfSubjectRulesReviewSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='selfSubjectRulesReviewSpec', url='', help=''), 4 | '#withNamespace':: d.fn(help='Namespace to evaluate rules for. Required.', args=[d.arg(name='namespace', type=d.T.string)]), 5 | withNamespace(namespace): { namespace: namespace }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta1/rollbackConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollbackConfig', url='', help='DEPRECATED.'), 4 | '#withRevision':: d.fn(help='The revision to rollback to. If set to 0, rollback to the last revision.', args=[d.arg(name='revision', type=d.T.integer)]), 5 | withRevision(revision): { revision: revision }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authorization/v1beta1/selfSubjectRulesReviewSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='selfSubjectRulesReviewSpec', url='', help=''), 4 | '#withNamespace':: d.fn(help='Namespace to evaluate rules for. Required.', args=[d.arg(name='namespace', type=d.T.string)]), 5 | withNamespace(namespace): { namespace: namespace }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /cmd/grafana-agent-crow/README.md: -------------------------------------------------------------------------------- 1 | # Crow 2 | 3 | Crow is a tool similar to Tempo Vulture and Loki Canary that is used to smoke test Grafana Agent. Crow works by generating metrics, then validating them against Prometheus. Crow uses two endpoints; the traditional `/metrics` and then `/validate` that generates the results of Crow checking for successful samples. 4 | 5 | Note: The `/validate` endpoint should only be checked by the Grafana Agent instance that is configured to remote_write. -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/rollbackConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollbackConfig', url='', help='DEPRECATED.'), 4 | '#withRevision':: d.fn(help='The revision to rollback to. If set to 0, rollback to the last revision.', args=[d.arg(name='revision', type=d.T.integer)]), 5 | withRevision(revision): { revision: revision }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/scaleSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scaleSpec', url='', help='describes the attributes of a scale subresource'), 4 | '#withReplicas':: d.fn(help='desired number of instances for the scaled object.', args=[d.arg(name='replicas', type=d.T.integer)]), 5 | withReplicas(replicas): { replicas: replicas }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta1/scaleSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scaleSpec', url='', help='ScaleSpec describes the attributes of a scale subresource'), 4 | '#withReplicas':: d.fn(help='desired number of instances for the scaled object.', args=[d.arg(name='replicas', type=d.T.integer)]), 5 | withReplicas(replicas): { replicas: replicas }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta2/scaleSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scaleSpec', url='', help='ScaleSpec describes the attributes of a scale subresource'), 4 | '#withReplicas':: d.fn(help='desired number of instances for the scaled object.', args=[d.arg(name='replicas', type=d.T.integer)]), 5 | withReplicas(replicas): { replicas: replicas }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/daemonEndpoint.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='daemonEndpoint', url='', help='DaemonEndpoint contains information about a single Daemon endpoint.'), 4 | '#withPort':: d.fn(help='Port number of the given endpoint.', args=[d.arg(name='port', type=d.T.integer)]), 5 | withPort(port): { port: port }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/v1/scaleSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scaleSpec', url='', help='ScaleSpec describes the attributes of a scale subresource.'), 4 | '#withReplicas':: d.fn(help='desired number of instances for the scaled object.', args=[d.arg(name='replicas', type=d.T.integer)]), 5 | withReplicas(replicas): { replicas: replicas }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/templates/loki/main.jsonnet: -------------------------------------------------------------------------------- 1 | local agent = import 'grafana-agent/v1/main.libsonnet'; 2 | 3 | { 4 | agent: 5 | agent.new('grafana-agent-logs', 'YOUR_NAMESPACE') + 6 | agent.withConfigHash(false) + 7 | agent.withImages({ 8 | agent: (import 'version.libsonnet'), 9 | }) + agent.withLogsConfig(agent.scrapeKubernetesLogs) + { 10 | agent+: { 11 | // Remove ConfigMap 12 | config_map:: {}, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authorization/v1/selfSubjectRulesReviewSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='selfSubjectRulesReviewSpec', url='', help=''), 4 | '#withNamespace':: d.fn(help='Namespace to evaluate rules for. Required.', args=[d.arg(name='namespace', type=d.T.string)]), 5 | withNamespace(namespace): { namespace: namespace }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/discovery/v1/forZone.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='forZone', url='', help='ForZone provides information about which zones should consume this endpoint.'), 4 | '#withName':: d.fn(help='name represents the name of the zone.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/policy/v1beta1/allowedCSIDriver.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedCSIDriver', url='', help='AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.'), 4 | '#withName':: d.fn(help='Name is the registered name of the CSI driver', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authorization/v1beta1/selfSubjectRulesReviewSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='selfSubjectRulesReviewSpec', url='', help=''), 4 | '#withNamespace':: d.fn(help='Namespace to evaluate rules for. Required.', args=[d.arg(name='namespace', type=d.T.string)]), 5 | withNamespace(namespace): { namespace: namespace }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/discovery/v1beta1/forZone.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='forZone', url='', help='ForZone provides information about which zones should consume this endpoint.'), 4 | '#withName':: d.fn(help='name represents the name of the zone.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/allowedCSIDriver.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedCSIDriver', url='', help='AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.'), 4 | '#withName':: d.fn(help='Name is the registered name of the CSI driver', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/lib/collector/collector-config.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | receivers: { 3 | otlp: { 4 | protocols: { 5 | grpc: null, 6 | }, 7 | }, 8 | }, 9 | 10 | exporters: { 11 | logging: { 12 | loglevel: "info", 13 | }, 14 | }, 15 | 16 | service: { 17 | pipelines: { 18 | traces: { 19 | receivers: [ 20 | "otlp", 21 | ], 22 | exporters: [ 23 | "logging", 24 | ], 25 | }, 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/policy/v1beta1/allowedFlexVolume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedFlexVolume', url='', help='AllowedFlexVolume represents a single Flexvolume that is allowed to be used.'), 4 | '#withDriver':: d.fn(help='driver is the name of the Flexvolume driver.', args=[d.arg(name='driver', type=d.T.string)]), 5 | withDriver(driver): { driver: driver }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/docker-compose/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 | -------------------------------------------------------------------------------- /example/k3d/assets/order.uml: -------------------------------------------------------------------------------- 1 | @startuml 2 | Crow -> Crow: Crow Generates Metrics 3 | Agent -> Crow: Agent scrapes /metrics endpoint 4 | Agent -> Prometheus: Agent sends results to prometheus 5 | Crow -> Prometheus: Crow checks that metrics were written to prometheus 6 | Crow -> Crow: Crow updates success/failure metrics and serves those via /validate 7 | Agent -> Crow: Agent scrapes /validate 8 | Agent -> Prometheus: Agent sends validate metrics 9 | Prometheus -> Prometheus: Prometheus checks alerts 10 | @enduml -------------------------------------------------------------------------------- /cmd/agent/agent-local-config.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | log_level: info 3 | http_listen_port: 12345 4 | 5 | prometheus: 6 | global: 7 | scrape_interval: 1m 8 | configs: 9 | - name: test 10 | host_filter: false 11 | scrape_configs: 12 | - job_name: local_scrape 13 | static_configs: 14 | - targets: ['127.0.0.1:12345'] 15 | labels: 16 | cluster: 'localhost' 17 | remote_write: 18 | - url: http://localhost:9009/api/prom/push 19 | -------------------------------------------------------------------------------- /production/kubernetes/build/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck shell=bash 3 | 4 | set +e 5 | 6 | DIRNAME=$(dirname "$0") 7 | 8 | pushd "${DIRNAME}" || exit 1 9 | # Make sure dependencies are up to date 10 | jb install 11 | tk show --dangerous-allow-redirect ./templates/bare > "${PWD}/../agent-bare.yaml" 12 | tk show --dangerous-allow-redirect ./templates/loki > "${PWD}/../agent-loki.yaml" 13 | tk show --dangerous-allow-redirect ./templates/traces > "${PWD}/../agent-traces.yaml" 14 | popd || exit 1 15 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/v1/scaleSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='scaleSpec', url='', help='ScaleSpec describes the attributes of a scale subresource.'), 4 | '#withReplicas':: d.fn(help='desired number of instances for the scaled object.', args=[d.arg(name='replicas', type=d.T.integer)]), 5 | withReplicas(replicas): { replicas: replicas }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/objectFieldSelector.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='objectFieldSelector', url='', help='ObjectFieldSelector selects an APIVersioned field of an object.'), 4 | '#withFieldPath':: d.fn(help='Path of the field to select in the specified API version.', args=[d.arg(name='fieldPath', type=d.T.string)]), 5 | withFieldPath(fieldPath): { fieldPath: fieldPath }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /pkg/util/compare_yaml.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | 6 | "gopkg.in/yaml.v2" 7 | ) 8 | 9 | // CompareYAML marshals a and b to YAML and ensures that their contents are 10 | // equal. If either Marshal fails, CompareYAML returns false. 11 | func CompareYAML(a, b interface{}) bool { 12 | aBytes, err := yaml.Marshal(a) 13 | if err != nil { 14 | return false 15 | } 16 | bBytes, err := yaml.Marshal(b) 17 | if err != nil { 18 | return false 19 | } 20 | return bytes.Equal(aBytes, bBytes) 21 | } 22 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/v1beta1/allowedCSIDriver.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedCSIDriver', url='', help='AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.'), 4 | '#withName':: d.fn(help='Name is the registered name of the CSI driver', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | volumeAttachment: (import 'volumeAttachment.libsonnet'), 5 | volumeAttachmentSource: (import 'volumeAttachmentSource.libsonnet'), 6 | volumeAttachmentSpec: (import 'volumeAttachmentSpec.libsonnet'), 7 | volumeAttachmentStatus: (import 'volumeAttachmentStatus.libsonnet'), 8 | volumeError: (import 'volumeError.libsonnet') 9 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiregistration/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | apiService: (import 'apiService.libsonnet'), 5 | apiServiceCondition: (import 'apiServiceCondition.libsonnet'), 6 | apiServiceSpec: (import 'apiServiceSpec.libsonnet'), 7 | apiServiceStatus: (import 'apiServiceStatus.libsonnet'), 8 | serviceReference: (import 'serviceReference.libsonnet'), 9 | } 10 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/v1beta1/userSubject.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='userSubject', url='', help='UserSubject holds detailed information for user-kind subject.'), 4 | '#withName':: d.fn(help='`name` is the username that matches, or "*" to match all usernames. Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/v1beta1/allowedFlexVolume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedFlexVolume', url='', help='AllowedFlexVolume represents a single Flexvolume that is allowed to be used.'), 4 | '#withDriver':: d.fn(help='driver is the name of the Flexvolume driver.', args=[d.arg(name='driver', type=d.T.string)]), 5 | withDriver(driver): { driver: driver }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiregistration/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | apiService: (import 'apiService.libsonnet'), 5 | apiServiceCondition: (import 'apiServiceCondition.libsonnet'), 6 | apiServiceSpec: (import 'apiServiceSpec.libsonnet'), 7 | apiServiceStatus: (import 'apiServiceStatus.libsonnet'), 8 | serviceReference: (import 'serviceReference.libsonnet'), 9 | } 10 | -------------------------------------------------------------------------------- /production/kubernetes/build/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dependencies": [ 4 | { 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/jsonnet-libs/k8s-libsonnet", 8 | "subdir": "1.21" 9 | } 10 | }, 11 | "version": "main" 12 | }, 13 | { 14 | "source": { 15 | "local": { 16 | "directory": "../../tanka/grafana-agent" 17 | } 18 | }, 19 | "version": "" 20 | } 21 | ], 22 | "legacyImports": true 23 | } 24 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/objectFieldSelector.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='objectFieldSelector', url='', help='ObjectFieldSelector selects an APIVersioned field of an object.'), 4 | '#withFieldPath':: d.fn(help='Path of the field to select in the specified API version.', args=[d.arg(name='fieldPath', type=d.T.string)]), 5 | withFieldPath(fieldPath): { fieldPath: fieldPath }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/discovery/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | endpoint: (import 'endpoint.libsonnet'), 5 | endpointConditions: (import 'endpointConditions.libsonnet'), 6 | endpointHints: (import 'endpointHints.libsonnet'), 7 | endpointPort: (import 'endpointPort.libsonnet'), 8 | endpointSlice: (import 'endpointSlice.libsonnet'), 9 | forZone: (import 'forZone.libsonnet'), 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/certificates/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | certificateSigningRequest: (import 'certificateSigningRequest.libsonnet'), 5 | certificateSigningRequestCondition: (import 'certificateSigningRequestCondition.libsonnet'), 6 | certificateSigningRequestSpec: (import 'certificateSigningRequestSpec.libsonnet'), 7 | certificateSigningRequestStatus: (import 'certificateSigningRequestStatus.libsonnet') 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/podReadinessGate.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='podReadinessGate', url='', help='PodReadinessGate contains the reference to a pod condition'), 4 | '#withConditionType':: d.fn(help="ConditionType refers to a condition in the pod's condition list with matching type.", args=[d.arg(name='conditionType', type=d.T.string)]), 5 | withConditionType(conditionType): { conditionType: conditionType }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/discovery/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | endpoint: (import 'endpoint.libsonnet'), 5 | endpointConditions: (import 'endpointConditions.libsonnet'), 6 | endpointHints: (import 'endpointHints.libsonnet'), 7 | endpointPort: (import 'endpointPort.libsonnet'), 8 | endpointSlice: (import 'endpointSlice.libsonnet'), 9 | forZone: (import 'forZone.libsonnet'), 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/namespaceStatus.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='namespaceStatus', url='', help='NamespaceStatus is information about the current status of a Namespace.'), 4 | '#withPhase':: d.fn(help='Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/', args=[d.arg(name='phase', type=d.T.string)]), 5 | withPhase(phase): { phase: phase }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/podDNSConfigOption.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='podDNSConfigOption', url='', help='PodDNSConfigOption defines DNS resolver options of a pod.'), 4 | '#withName':: d.fn(help='Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/sysctl.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='sysctl', url='', help='Sysctl defines a kernel parameter to be set'), 4 | '#withName':: d.fn(help='Name of a property to set', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='Value of a property to set', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/allowedFlexVolume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='allowedFlexVolume', url='', help='AllowedFlexVolume represents a single Flexvolume that is allowed to be used. Deprecated: use AllowedFlexVolume from policy API Group instead.'), 4 | '#withDriver':: d.fn(help='driver is the name of the Flexvolume driver.', args=[d.arg(name='driver', type=d.T.string)]), 5 | withDriver(driver): { driver: driver }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/certificates/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | certificateSigningRequest: (import 'certificateSigningRequest.libsonnet'), 5 | certificateSigningRequestCondition: (import 'certificateSigningRequestCondition.libsonnet'), 6 | certificateSigningRequestSpec: (import 'certificateSigningRequestSpec.libsonnet'), 7 | certificateSigningRequestStatus: (import 'certificateSigningRequestStatus.libsonnet'), 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/podIP.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='podIP', url='', help='IP address information for entries in the (plural) PodIPs field. Each entry includes:\n IP: An IP address allocated to the pod. Routable at least within the cluster.'), 4 | '#withIp':: d.fn(help='ip is an IP address (IPv4 or IPv6) assigned to the pod', args=[d.arg(name='ip', type=d.T.string)]), 5 | withIp(ip): { ip: ip }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | storageClass: (import 'storageClass.libsonnet'), 5 | volumeAttachment: (import 'volumeAttachment.libsonnet'), 6 | volumeAttachmentSource: (import 'volumeAttachmentSource.libsonnet'), 7 | volumeAttachmentSpec: (import 'volumeAttachmentSpec.libsonnet'), 8 | volumeAttachmentStatus: (import 'volumeAttachmentStatus.libsonnet'), 9 | volumeError: (import 'volumeError.libsonnet') 10 | } -------------------------------------------------------------------------------- /packaging/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 | # Log level. Valid levels: [debug, info, warn, error] (default info) 10 | LOG_LEVEL="error" 11 | 12 | # The configuration file holding the agent config 13 | CONFIG_FILE="/etc/grafana-agent.yaml" 14 | 15 | # Any user defined arguments 16 | CUSTOM_ARGS="" 17 | 18 | # Restart on system upgrade. Default to true 19 | RESTART_ON_UPGRADE=true 20 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apiserverinternal/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | serverStorageVersion: (import 'serverStorageVersion.libsonnet'), 5 | storageVersion: (import 'storageVersion.libsonnet'), 6 | storageVersionCondition: (import 'storageVersionCondition.libsonnet'), 7 | storageVersionSpec: (import 'storageVersionSpec.libsonnet'), 8 | storageVersionStatus: (import 'storageVersionStatus.libsonnet'), 9 | } 10 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/certificates/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | certificateSigningRequest: (import 'certificateSigningRequest.libsonnet'), 5 | certificateSigningRequestCondition: (import 'certificateSigningRequestCondition.libsonnet'), 6 | certificateSigningRequestSpec: (import 'certificateSigningRequestSpec.libsonnet'), 7 | certificateSigningRequestStatus: (import 'certificateSigningRequestStatus.libsonnet'), 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/podReadinessGate.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='podReadinessGate', url='', help='PodReadinessGate contains the reference to a pod condition'), 4 | '#withConditionType':: d.fn(help="ConditionType refers to a condition in the pod's condition list with matching type.", args=[d.arg(name='conditionType', type=d.T.string)]), 5 | withConditionType(conditionType): { conditionType: conditionType }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/httpHeader.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='httpHeader', url='', help='HTTPHeader describes a custom header to be used in HTTP probes'), 4 | '#withName':: d.fn(help='The header field name', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='The header field value', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/podDNSConfigOption.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='podDNSConfigOption', url='', help='PodDNSConfigOption defines DNS resolver options of a pod.'), 4 | '#withName':: d.fn(help='Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/v1beta1/flowDistinguisherMethod.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='flowDistinguisherMethod', url='', help='FlowDistinguisherMethod specifies the method of a flow distinguisher.'), 4 | '#withType':: d.fn(help='`type` is the type of flow distinguisher method The supported types are "ByUser" and "ByNamespace". Required.', args=[d.arg(name='type', type=d.T.string)]), 5 | withType(type): { type: type }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /cmd/agent-operator/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16-buster as build 2 | COPY . /src/agent 3 | WORKDIR /src/agent 4 | ARG RELEASE_BUILD=false 5 | ARG IMAGE_TAG 6 | 7 | RUN make clean && make IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false agent-operator 8 | 9 | FROM debian:buster-slim 10 | 11 | RUN apt-get update && \ 12 | apt-get install -qy tzdata ca-certificates && \ 13 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | COPY --from=build /src/agent/cmd/agent-operator/agent-operator /bin/agent-operator 16 | 17 | ENTRYPOINT ["/bin/agent-operator"] 18 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/localObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='localObjectReference', url='', help='LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.'), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/sysctl.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='sysctl', url='', help='Sysctl defines a kernel parameter to be set'), 4 | '#withName':: d.fn(help='Name of a property to set', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='Value of a property to set', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/scripts/create.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | EXTRA_MOUNTS="" 4 | 5 | if [ -f /etc/machine-id ]; then 6 | EXTRA_MOUNTS="$EXTRA_MOUNTS -v /etc/machine-id:/etc/machine-id" 7 | fi 8 | 9 | if [ -d /dev/mapper ]; then 10 | EXTRA_MOUNTS="$EXTRA_MOUNTS -v /dev/mapper:/dev/mapper" 11 | fi 12 | 13 | k3d cluster create agent-k3d \ 14 | --port 30080:80@loadbalancer \ 15 | --api-port 50443 \ 16 | -v /var/lib/k3d/agent-k3d/storage/:/var/lib/rancher/k3s/storage/ \ 17 | $EXTRA_MOUNTS \ 18 | --kubeconfig-update-default=true \ 19 | --kubeconfig-switch-context=true \ 20 | --wait 21 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/policy/v1beta1/idRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='idRange', url='', help='IDRange provides a min/max of an allowed range of IDs.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet') 12 | } -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/link.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | dashboards( 3 | title, 4 | tags, 5 | asDropdown=true, 6 | includeVars=false, 7 | keepTime=false, 8 | icon='external link', 9 | url='', 10 | targetBlank=false, 11 | type='dashboards', 12 | ):: 13 | { 14 | asDropdown: asDropdown, 15 | icon: icon, 16 | includeVars: includeVars, 17 | keepTime: keepTime, 18 | tags: tags, 19 | title: title, 20 | type: type, 21 | url: url, 22 | targetBlank: targetBlank, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/auditregistration/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | auditSink: (import 'auditSink.libsonnet'), 5 | auditSinkSpec: (import 'auditSinkSpec.libsonnet'), 6 | policy: (import 'policy.libsonnet'), 7 | serviceReference: (import 'serviceReference.libsonnet'), 8 | webhook: (import 'webhook.libsonnet'), 9 | webhookClientConfig: (import 'webhookClientConfig.libsonnet'), 10 | webhookThrottleConfig: (import 'webhookThrottleConfig.libsonnet') 11 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet') 12 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet') 12 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta1/rollingUpdateStatefulSetStrategy.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateStatefulSetStrategy', url='', help='RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.'), 4 | '#withPartition':: d.fn(help='Partition indicates the ordinal at which the StatefulSet should be partitioned.', args=[d.arg(name='partition', type=d.T.integer)]), 5 | withPartition(partition): { partition: partition }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/batch/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | cronJob: (import 'cronJob.libsonnet'), 5 | cronJobSpec: (import 'cronJobSpec.libsonnet'), 6 | cronJobStatus: (import 'cronJobStatus.libsonnet'), 7 | job: (import 'job.libsonnet'), 8 | jobCondition: (import 'jobCondition.libsonnet'), 9 | jobSpec: (import 'jobSpec.libsonnet'), 10 | jobStatus: (import 'jobStatus.libsonnet'), 11 | jobTemplateSpec: (import 'jobTemplateSpec.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/httpHeader.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='httpHeader', url='', help='HTTPHeader describes a custom header to be used in HTTP probes'), 4 | '#withName':: d.fn(help='The header field name', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withValue':: d.fn(help='The header field value', args=[d.arg(name='value', type=d.T.string)]), 7 | withValue(value): { value: value }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/text.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | new( 3 | title='', 4 | span=null, 5 | mode='markdown', 6 | content='', 7 | transparent=null, 8 | description=null, 9 | datasource=null, 10 | ):: 11 | { 12 | [if transparent != null then 'transparent']: transparent, 13 | title: title, 14 | [if span != null then 'span']: span, 15 | type: 'text', 16 | mode: mode, 17 | content: content, 18 | [if description != null then 'description']: description, 19 | datasource: datasource, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/timepicker.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | new( 3 | refresh_intervals=[ 4 | '5s', 5 | '10s', 6 | '30s', 7 | '1m', 8 | '5m', 9 | '15m', 10 | '30m', 11 | '1h', 12 | '2h', 13 | '1d', 14 | ], 15 | time_options=[ 16 | '5m', 17 | '15m', 18 | '1h', 19 | '6h', 20 | '12h', 21 | '24h', 22 | '2d', 23 | '7d', 24 | '30d', 25 | ], 26 | ):: { 27 | refresh_intervals: refresh_intervals, 28 | time_options: time_options, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /pkg/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 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/localObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='localObjectReference', url='', help='LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.'), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/v1beta1/priorityLevelConfigurationReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='priorityLevelConfigurationReference', url='', help='PriorityLevelConfigurationReference contains information that points to the "request-priority" being used.'), 4 | '#withName':: d.fn(help='`name` is the name of the priority level configuration being referenced Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1/rollingUpdateStatefulSetStrategy.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateStatefulSetStrategy', url='', help='RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.'), 4 | '#withPartition':: d.fn(help='Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0.', args=[d.arg(name='partition', type=d.T.integer)]), 5 | withPartition(partition): { partition: partition }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/containerStateRunning.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='containerStateRunning', url='', help='ContainerStateRunning is a running state of a container.'), 4 | '#withStartedAt':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='startedAt', type=d.T.string)]), 5 | withStartedAt(startedAt): { startedAt: startedAt }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/nodeAddress.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nodeAddress', url='', help="NodeAddress contains information for the node's address."), 4 | '#withAddress':: d.fn(help='The node address.', args=[d.arg(name='address', type=d.T.string)]), 5 | withAddress(address): { address: address }, 6 | '#withType':: d.fn(help='Node address type, one of Hostname, ExternalIP or InternalIP.', args=[d.arg(name='type', type=d.T.string)]), 7 | withType(type): { type: type }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/grafana-agent-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 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/v1beta1/idRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='idRange', url='', help='IDRange provides a min/max of an allowed range of IDs.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/storage/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | csiStorageCapacity: (import 'csiStorageCapacity.libsonnet'), 5 | volumeAttachment: (import 'volumeAttachment.libsonnet'), 6 | volumeAttachmentSource: (import 'volumeAttachmentSource.libsonnet'), 7 | volumeAttachmentSpec: (import 'volumeAttachmentSpec.libsonnet'), 8 | volumeAttachmentStatus: (import 'volumeAttachmentStatus.libsonnet'), 9 | volumeError: (import 'volumeError.libsonnet'), 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/admissionregistration/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | mutatingWebhookConfiguration: (import 'mutatingWebhookConfiguration.libsonnet'), 5 | ruleWithOperations: (import 'ruleWithOperations.libsonnet'), 6 | serviceReference: (import 'serviceReference.libsonnet'), 7 | validatingWebhookConfiguration: (import 'validatingWebhookConfiguration.libsonnet'), 8 | webhook: (import 'webhook.libsonnet'), 9 | webhookClientConfig: (import 'webhookClientConfig.libsonnet') 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta2/rollingUpdateStatefulSetStrategy.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateStatefulSetStrategy', url='', help='RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.'), 4 | '#withPartition':: d.fn(help='Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0.', args=[d.arg(name='partition', type=d.T.integer)]), 5 | withPartition(partition): { partition: partition }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /production/kubernetes/build/templates/bare/main.jsonnet: -------------------------------------------------------------------------------- 1 | local agent = import 'grafana-agent/v1/main.libsonnet'; 2 | 3 | { 4 | agent: 5 | agent.newDeployment('grafana-agent', '${NAMESPACE}') + 6 | agent.withConfigHash(false) + 7 | agent.withImages({ 8 | agent: (import 'version.libsonnet'), 9 | }) + { 10 | agent+: { 11 | // The listen port from the cloud config is set to 12345. 12 | listen_port:: 12345, 13 | 14 | // The bare deployment doesn't provide a ConfigMap by default, so 15 | // remove it from here. 16 | config_map:: {}, 17 | }, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /.github/workflows/check_docs.yml: -------------------------------------------------------------------------------- 1 | name: Check docs 2 | on: [pull_request] 3 | jobs: 4 | check-docs: 5 | name: Check links in docs 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Checkout code 9 | uses: actions/checkout@v2 10 | - name: Check links in docs 11 | uses: gaurav-nelson/github-action-markdown-link-check@v1 12 | # checks all markdown files from /docs including all subfolders 13 | with: 14 | use-quiet-mode: 'yes' 15 | use-verbose-mode: 'yes' 16 | config-file: '.github/workflows/markdown.links.config.json' 17 | folder-path: 'docs/,example/,production/' 18 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/eventSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='eventSource', url='', help='EventSource contains information for an event.'), 4 | '#withComponent':: d.fn(help='Component from which the event is generated.', args=[d.arg(name='component', type=d.T.string)]), 5 | withComponent(component): { component: component }, 6 | '#withHost':: d.fn(help='Node name on which the event is generated.', args=[d.arg(name='host', type=d.T.string)]), 7 | withHost(host): { host: host }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1alpha1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1alpha1', url='', help=''), 4 | aggregationRule: (import 'aggregationRule.libsonnet'), 5 | clusterRole: (import 'clusterRole.libsonnet'), 6 | clusterRoleBinding: (import 'clusterRoleBinding.libsonnet'), 7 | policyRule: (import 'policyRule.libsonnet'), 8 | role: (import 'role.libsonnet'), 9 | roleBinding: (import 'roleBinding.libsonnet'), 10 | roleRef: (import 'roleRef.libsonnet'), 11 | subject: (import 'subject.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/networking/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | ipBlock: (import 'ipBlock.libsonnet'), 5 | networkPolicy: (import 'networkPolicy.libsonnet'), 6 | networkPolicyEgressRule: (import 'networkPolicyEgressRule.libsonnet'), 7 | networkPolicyIngressRule: (import 'networkPolicyIngressRule.libsonnet'), 8 | networkPolicyPeer: (import 'networkPolicyPeer.libsonnet'), 9 | networkPolicyPort: (import 'networkPolicyPort.libsonnet'), 10 | networkPolicySpec: (import 'networkPolicySpec.libsonnet') 11 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/link.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name link.dashboards 4 | */ 5 | dashboards( 6 | title, 7 | tags, 8 | asDropdown=true, 9 | includeVars=false, 10 | keepTime=false, 11 | icon='external link', 12 | url='', 13 | targetBlank=false, 14 | type='dashboards', 15 | ):: 16 | { 17 | asDropdown: asDropdown, 18 | icon: icon, 19 | includeVars: includeVars, 20 | keepTime: keepTime, 21 | tags: tags, 22 | title: title, 23 | type: type, 24 | url: url, 25 | targetBlank: targetBlank, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/networking/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | httpIngressPath: (import 'httpIngressPath.libsonnet'), 5 | httpIngressRuleValue: (import 'httpIngressRuleValue.libsonnet'), 6 | ingress: (import 'ingress.libsonnet'), 7 | ingressBackend: (import 'ingressBackend.libsonnet'), 8 | ingressRule: (import 'ingressRule.libsonnet'), 9 | ingressSpec: (import 'ingressSpec.libsonnet'), 10 | ingressStatus: (import 'ingressStatus.libsonnet'), 11 | ingressTLS: (import 'ingressTLS.libsonnet') 12 | } -------------------------------------------------------------------------------- /packaging/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 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: [pull_request] 3 | jobs: 4 | test: 5 | name: Test 6 | strategy: 7 | matrix: 8 | platform: [macos-latest, windows-latest] 9 | runs-on: ${{ matrix.platform }} 10 | steps: 11 | - name: Set up Go 1.16 12 | uses: actions/setup-go@v1 13 | with: 14 | go-version: 1.16 15 | id: go 16 | - name: Checkout code 17 | uses: actions/checkout@v2 18 | - name: Build 19 | run: make BUILD_IN_CONTAINER=false cmd/agent/agent cmd/agentctl/agentctl cmd/agent-operator/agent-operator 20 | - name: Test 21 | run: make BUILD_IN_CONTAINER=false test -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/text.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name text.new 4 | */ 5 | new( 6 | title='', 7 | span=null, 8 | mode='markdown', 9 | content='', 10 | transparent=null, 11 | description=null, 12 | datasource=null, 13 | ):: 14 | { 15 | [if transparent != null then 'transparent']: transparent, 16 | title: title, 17 | [if span != null then 'span']: span, 18 | type: 'text', 19 | mode: mode, 20 | content: content, 21 | [if description != null then 'description']: description, 22 | datasource: datasource, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/nodeDaemonEndpoints.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nodeDaemonEndpoints', url='', help='NodeDaemonEndpoints lists ports opened by daemons running on the Node.'), 4 | '#kubeletEndpoint':: d.obj(help='DaemonEndpoint contains information about a single Daemon endpoint.'), 5 | kubeletEndpoint: { 6 | '#withPort':: d.fn(help='Port number of the given endpoint.', args=[d.arg(name='port', type=d.T.integer)]), 7 | withPort(port): { kubeletEndpoint+: { port: port } } 8 | }, 9 | '#mixin': 'ignore', 10 | mixin: self 11 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/apps/v1/rollingUpdateStatefulSetStrategy.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateStatefulSetStrategy', url='', help='RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.'), 4 | '#withPartition':: d.fn(help='Partition indicates the ordinal at which the StatefulSet should be partitioned. Default value is 0.', args=[d.arg(name='partition', type=d.T.integer)]), 5 | withPartition(partition): { partition: partition }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/containerStateRunning.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='containerStateRunning', url='', help='ContainerStateRunning is a running state of a container.'), 4 | '#withStartedAt':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='startedAt', type=d.T.string)]), 5 | withStartedAt(startedAt): { startedAt: startedAt }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/v1beta1/groupSubject.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='groupSubject', url='', help='GroupSubject holds detailed information for group-kind subject.'), 4 | '#withName':: d.fn(help='name is the user group that matches, or "*" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-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": "mixin-utils", 15 | "source": { 16 | "git": { 17 | "remote": "https://github.com/grafana/jsonnet-libs", 18 | "subdir": "mixin-utils" 19 | } 20 | }, 21 | "version": "master" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/timepicker.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name timepicker.new 4 | */ 5 | new( 6 | refresh_intervals=[ 7 | '5s', 8 | '10s', 9 | '30s', 10 | '1m', 11 | '5m', 12 | '15m', 13 | '30m', 14 | '1h', 15 | '2h', 16 | '1d', 17 | ], 18 | time_options=[ 19 | '5m', 20 | '15m', 21 | '1h', 22 | '6h', 23 | '12h', 24 | '24h', 25 | '2d', 26 | '7d', 27 | '30d', 28 | ], 29 | ):: { 30 | refresh_intervals: refresh_intervals, 31 | time_options: time_options, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/idRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='idRange', url='', help='IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange from policy API Group instead.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/nodeAddress.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nodeAddress', url='', help="NodeAddress contains information for the node's address."), 4 | '#withAddress':: d.fn(help='The node address.', args=[d.arg(name='address', type=d.T.string)]), 5 | withAddress(address): { address: address }, 6 | '#withType':: d.fn(help='Node address type, one of Hostname, ExternalIP or InternalIP.', args=[d.arg(name='type', type=d.T.string)]), 7 | withType(type): { type: type }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | Robert Fratto ( / @rfratto) is the main/default maintainer, some parts of the codebase have other maintainers: 2 | 3 | * `pkg` 4 | * `traces`: Joe Elliott ( / @joe-elliott), Mario Rodriguez (/ @mapno) 5 | 6 | For the sake of brevity, not all subtrees are explicitly listed. Due to the 7 | size of this repository, the natural changes in focus of maintainers over time, 8 | and nuances of where particular features live, this list will always be 9 | incomplete and out of date. However the listed maintainer(s) should be able to 10 | direct a PR/question to the right person. 11 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/prometheus.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | target( 3 | expr, 4 | format='time_series', 5 | intervalFactor=2, 6 | legendFormat='', 7 | datasource=null, 8 | interval=null, 9 | instant=null, 10 | hide=null, 11 | ):: { 12 | [if hide != null then 'hide']: hide, 13 | [if datasource != null then 'datasource']: datasource, 14 | expr: expr, 15 | format: format, 16 | intervalFactor: intervalFactor, 17 | legendFormat: legendFormat, 18 | [if interval != null then 'interval']: interval, 19 | [if instant != null then 'instant']: instant, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | crossVersionObjectReference: (import 'crossVersionObjectReference.libsonnet'), 5 | horizontalPodAutoscaler: (import 'horizontalPodAutoscaler.libsonnet'), 6 | horizontalPodAutoscalerSpec: (import 'horizontalPodAutoscalerSpec.libsonnet'), 7 | horizontalPodAutoscalerStatus: (import 'horizontalPodAutoscalerStatus.libsonnet'), 8 | scale: (import 'scale.libsonnet'), 9 | scaleSpec: (import 'scaleSpec.libsonnet'), 10 | scaleStatus: (import 'scaleStatus.libsonnet') 11 | } -------------------------------------------------------------------------------- /pkg/build/build.go: -------------------------------------------------------------------------------- 1 | package build 2 | 3 | import "github.com/prometheus/common/version" 4 | 5 | // Version information passed to Prometheus version package. 6 | // Package path as used by linker changes based on vendoring being used or not, 7 | // so it's easier just to use stable Agent path, and pass it to 8 | // Prometheus in the code. 9 | var ( 10 | Version string 11 | Revision string 12 | Branch string 13 | BuildUser string 14 | BuildDate string 15 | ) 16 | 17 | func init() { 18 | version.Version = Version 19 | version.Revision = Revision 20 | version.Branch = Branch 21 | version.BuildUser = BuildUser 22 | version.BuildDate = BuildDate 23 | } 24 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/eventSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='eventSource', url='', help='EventSource contains information for an event.'), 4 | '#withComponent':: d.fn(help='Component from which the event is generated.', args=[d.arg(name='component', type=d.T.string)]), 5 | withComponent(component): { component: component }, 6 | '#withHost':: d.fn(help='Node name on which the event is generated.', args=[d.arg(name='host', type=d.T.string)]), 7 | withHost(host): { host: host }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/attachedVolume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='attachedVolume', url='', help='AttachedVolume describes a volume attached to a node'), 4 | '#withDevicePath':: d.fn(help='DevicePath represents the device path where the volume should be available', args=[d.arg(name='devicePath', type=d.T.string)]), 5 | withDevicePath(devicePath): { devicePath: devicePath }, 6 | '#withName':: d.fn(help='Name of the attached volume', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/lib/grafana/datasource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | new(name, url, default=false, method='GET', type='prometheus'):: { 3 | apiVersion: 1, 4 | datasources: [{ 5 | name: name, 6 | type: type, 7 | access: 'proxy', 8 | url: url, 9 | isDefault: default, 10 | version: 1, 11 | editable: false, 12 | jsonData: { 13 | httpMethod: method, 14 | }, 15 | }], 16 | }, 17 | 18 | withBasicAuth(username, password):: { 19 | datasources: std.map(function(ds) ds { 20 | basicAuth: true, 21 | basicAuthUser: username, 22 | basicAuthPassword: password, 23 | }, super.datasources), 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/nodeDaemonEndpoints.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nodeDaemonEndpoints', url='', help='NodeDaemonEndpoints lists ports opened by daemons running on the Node.'), 4 | '#kubeletEndpoint':: d.obj(help='DaemonEndpoint contains information about a single Daemon endpoint.'), 5 | kubeletEndpoint: { 6 | '#withPort':: d.fn(help='Port number of the given endpoint.', args=[d.arg(name='port', type=d.T.integer)]), 7 | withPort(port): { kubeletEndpoint+: { port: port } }, 8 | }, 9 | '#mixin': 'ignore', 10 | mixin: self, 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/extensions/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | httpIngressPath: (import 'httpIngressPath.libsonnet'), 5 | httpIngressRuleValue: (import 'httpIngressRuleValue.libsonnet'), 6 | ingress: (import 'ingress.libsonnet'), 7 | ingressBackend: (import 'ingressBackend.libsonnet'), 8 | ingressRule: (import 'ingressRule.libsonnet'), 9 | ingressSpec: (import 'ingressSpec.libsonnet'), 10 | ingressStatus: (import 'ingressStatus.libsonnet'), 11 | ingressTLS: (import 'ingressTLS.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /cmd/agent-operator/Dockerfile.buildx: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM rfratto/seego:latest as build 2 | ARG TARGETPLATFORM 3 | ARG BUILDPLATFORM 4 | 5 | COPY . /src/agent 6 | WORKDIR /src/agent 7 | ARG RELEASE_BUILD=true 8 | ARG IMAGE_TAG 9 | 10 | RUN make clean && make IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false DRONE=true agent-operator 11 | 12 | FROM debian:buster-slim 13 | 14 | RUN apt-get update && \ 15 | apt-get install -qy tzdata ca-certificates && \ 16 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 17 | 18 | COPY --from=build /src/agent/cmd/agent-operator/agent-operator /bin/agent-operator 19 | 20 | ENTRYPOINT ["/bin/agent-operator"] 21 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/clientIPConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='clientIPConfig', url='', help='ClientIPConfig represents the configurations of Client IP based session affinity.'), 4 | '#withTimeoutSeconds':: d.fn(help='timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours).', args=[d.arg(name='timeoutSeconds', type=d.T.integer)]), 5 | withTimeoutSeconds(timeoutSeconds): { timeoutSeconds: timeoutSeconds }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/containerStateWaiting.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='containerStateWaiting', url='', help='ContainerStateWaiting is a waiting state of a container.'), 4 | '#withMessage':: d.fn(help='Message regarding why the container is not yet running.', args=[d.arg(name='message', type=d.T.string)]), 5 | withMessage(message): { message: message }, 6 | '#withReason':: d.fn(help='(brief) reason the container is not yet running.', args=[d.arg(name='reason', type=d.T.string)]), 7 | withReason(reason): { reason: reason }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authorization/v1/nonResourceAttributes.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nonResourceAttributes', url='', help='NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface'), 4 | '#withPath':: d.fn(help='Path is the URL path of the request', args=[d.arg(name='path', type=d.T.string)]), 5 | withPath(path): { path: path }, 6 | '#withVerb':: d.fn(help='Verb is the standard HTTP verb', args=[d.arg(name='verb', type=d.T.string)]), 7 | withVerb(verb): { verb: verb }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/authorization/v1beta1/nonResourceAttributes.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nonResourceAttributes', url='', help='NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface'), 4 | '#withPath':: d.fn(help='Path is the URL path of the request', args=[d.arg(name='path', type=d.T.string)]), 5 | withPath(path): { path: path }, 6 | '#withVerb':: d.fn(help='Verb is the standard HTTP verb', args=[d.arg(name='verb', type=d.T.string)]), 7 | withVerb(verb): { verb: verb }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | crossVersionObjectReference: (import 'crossVersionObjectReference.libsonnet'), 5 | horizontalPodAutoscaler: (import 'horizontalPodAutoscaler.libsonnet'), 6 | horizontalPodAutoscalerSpec: (import 'horizontalPodAutoscalerSpec.libsonnet'), 7 | horizontalPodAutoscalerStatus: (import 'horizontalPodAutoscalerStatus.libsonnet'), 8 | scale: (import 'scale.libsonnet'), 9 | scaleSpec: (import 'scaleSpec.libsonnet'), 10 | scaleStatus: (import 'scaleStatus.libsonnet'), 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/attachedVolume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='attachedVolume', url='', help='AttachedVolume describes a volume attached to a node'), 4 | '#withDevicePath':: d.fn(help='DevicePath represents the device path where the volume should be available', args=[d.arg(name='devicePath', type=d.T.string)]), 5 | withDevicePath(devicePath): { devicePath: devicePath }, 6 | '#withName':: d.fn(help='Name of the attached volume', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/policy/v1beta1/hostPortRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='hostPortRange', url='', help='HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /pkg/util/test_logger.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | "time" 7 | 8 | "github.com/go-kit/kit/log" 9 | ) 10 | 11 | // TestLogger generates a logger for a test. 12 | func TestLogger(t *testing.T) log.Logger { 13 | t.Helper() 14 | 15 | l := log.NewSyncLogger(log.NewLogfmtLogger(os.Stderr)) 16 | l = log.WithPrefix(l, 17 | "test", t.Name(), 18 | "ts", log.Valuer(testTimestamp), 19 | ) 20 | 21 | return l 22 | } 23 | 24 | // testTimestamp is a log.Valuer that returns the timestamp 25 | // without the date or timezone, reducing the noise in the test. 26 | func testTimestamp() interface{} { 27 | t := time.Now().UTC() 28 | return t.Format("15:04:05.000") 29 | } 30 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authentication/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | boundObjectReference: (import 'boundObjectReference.libsonnet'), 5 | tokenRequest: (import 'tokenRequest.libsonnet'), 6 | tokenRequestSpec: (import 'tokenRequestSpec.libsonnet'), 7 | tokenRequestStatus: (import 'tokenRequestStatus.libsonnet'), 8 | tokenReview: (import 'tokenReview.libsonnet'), 9 | tokenReviewSpec: (import 'tokenReviewSpec.libsonnet'), 10 | tokenReviewStatus: (import 'tokenReviewStatus.libsonnet'), 11 | userInfo: (import 'userInfo.libsonnet'), 12 | } 13 | -------------------------------------------------------------------------------- /tools/seego/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rfratto/seego:latest as build 2 | 3 | # Use custom Go version instead of one prepacked in seego 4 | ENV GOLANG_VERSION 1.16 5 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz 6 | ENV GOLANG_DOWNLOAD_SHA256 013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2 7 | RUN rm -rf /usr/local/go \ 8 | && curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ 9 | && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ 10 | && tar -C /usr/local -xzf golang.tar.gz \ 11 | && rm golang.tar.gz 12 | RUN apt-get update 13 | RUN apt-get install -y nsis -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/prometheus.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name prometheus.target 4 | */ 5 | target( 6 | expr, 7 | format='time_series', 8 | intervalFactor=2, 9 | legendFormat='', 10 | datasource=null, 11 | interval=null, 12 | instant=null, 13 | hide=null, 14 | ):: { 15 | [if hide != null then 'hide']: hide, 16 | [if datasource != null then 'datasource']: datasource, 17 | expr: expr, 18 | format: format, 19 | intervalFactor: intervalFactor, 20 | legendFormat: legendFormat, 21 | [if interval != null then 'interval']: interval, 22 | [if instant != null then 'instant']: instant, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/clientIPConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='clientIPConfig', url='', help='ClientIPConfig represents the configurations of Client IP based session affinity.'), 4 | '#withTimeoutSeconds':: d.fn(help='timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours).', args=[d.arg(name='timeoutSeconds', type=d.T.integer)]), 5 | withTimeoutSeconds(timeoutSeconds): { timeoutSeconds: timeoutSeconds }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/containerStateWaiting.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='containerStateWaiting', url='', help='ContainerStateWaiting is a waiting state of a container.'), 4 | '#withMessage':: d.fn(help='Message regarding why the container is not yet running.', args=[d.arg(name='message', type=d.T.string)]), 5 | withMessage(message): { message: message }, 6 | '#withReason':: d.fn(help='(brief) reason the container is not yet running.', args=[d.arg(name='reason', type=d.T.string)]), 7 | withReason(reason): { reason: reason }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /pkg/agentproto/func.go: -------------------------------------------------------------------------------- 1 | package agentproto 2 | 3 | import ( 4 | "context" 5 | 6 | empty "github.com/golang/protobuf/ptypes/empty" 7 | ) 8 | 9 | // FuncScrapingServiceServer is an implementation of ScrapingServiceServer that 10 | // uses function fields to implement the interface. Useful for tests. 11 | type FuncScrapingServiceServer struct { 12 | ReshardFunc func(context.Context, *ReshardRequest) (*empty.Empty, error) 13 | } 14 | 15 | // Reshard implements ScrapingServiceServer. 16 | func (f *FuncScrapingServiceServer) Reshard(ctx context.Context, req *ReshardRequest) (*empty.Empty, error) { 17 | if f.ReshardFunc != nil { 18 | return f.ReshardFunc(ctx, req) 19 | } 20 | panic("ReshardFunc is nil") 21 | } 22 | -------------------------------------------------------------------------------- /pkg/traces/noopreceiver/receiver.go: -------------------------------------------------------------------------------- 1 | package noopreceiver 2 | 3 | import ( 4 | "context" 5 | 6 | "go.opentelemetry.io/collector/component" 7 | "go.opentelemetry.io/collector/consumer" 8 | "go.uber.org/zap" 9 | ) 10 | 11 | type noopReceiver struct{} 12 | 13 | // New creates a dummy receiver. 14 | func newNoopReceiver(_ *zap.Logger, _ *Config, _ consumer.Metrics) *noopReceiver { 15 | return &noopReceiver{} 16 | } 17 | 18 | // Start implements the Component interface. 19 | func (r *noopReceiver) Start(_ context.Context, _ component.Host) error { 20 | return nil 21 | } 22 | 23 | // Shutdown implements the Component interface. 24 | func (r *noopReceiver) Shutdown(context.Context) error { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authorization/v1/nonResourceAttributes.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nonResourceAttributes', url='', help='NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface'), 4 | '#withPath':: d.fn(help='Path is the URL path of the request', args=[d.arg(name='path', type=d.T.string)]), 5 | withPath(path): { path: path }, 6 | '#withVerb':: d.fn(help='Verb is the standard HTTP verb', args=[d.arg(name='verb', type=d.T.string)]), 7 | withVerb(verb): { verb: verb }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/templates/base/main.jsonnet: -------------------------------------------------------------------------------- 1 | local agent = import 'grafana-agent/grafana-agent.libsonnet'; 2 | 3 | agent { 4 | _images+:: { 5 | agent: (import 'version.libsonnet'), 6 | }, 7 | 8 | _config+:: { 9 | namespace: '${NAMESPACE}', 10 | agent_remote_write: [{ 11 | url: '${REMOTE_WRITE_URL}', 12 | basic_auth: { 13 | username: '${REMOTE_WRITE_USERNAME}', 14 | password: '${REMOTE_WRITE_PASSWORD}', 15 | }, 16 | }], 17 | 18 | // Since the config map isn't managed by Tanka, we don't want to 19 | // add the configmap's hash as an annotation for the Kubernetes 20 | // YAML manifest. 21 | agent_config_hash_annotation: false, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/admissionregistration/v1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1', url='', help=''), 4 | mutatingWebhook: (import 'mutatingWebhook.libsonnet'), 5 | mutatingWebhookConfiguration: (import 'mutatingWebhookConfiguration.libsonnet'), 6 | ruleWithOperations: (import 'ruleWithOperations.libsonnet'), 7 | serviceReference: (import 'serviceReference.libsonnet'), 8 | validatingWebhook: (import 'validatingWebhook.libsonnet'), 9 | validatingWebhookConfiguration: (import 'validatingWebhookConfiguration.libsonnet'), 10 | webhookClientConfig: (import 'webhookClientConfig.libsonnet'), 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authorization/v1beta1/nonResourceAttributes.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='nonResourceAttributes', url='', help='NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface'), 4 | '#withPath':: d.fn(help='Path is the URL path of the request', args=[d.arg(name='path', type=d.T.string)]), 5 | withPath(path): { path: path }, 6 | '#withVerb':: d.fn(help='Verb is the standard HTTP verb', args=[d.arg(name='verb', type=d.T.string)]), 7 | withVerb(verb): { verb: verb }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/policy/v1beta1/hostPortRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='hostPortRange', url='', help='HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/auditregistration/v1alpha1/webhookThrottleConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='webhookThrottleConfig', url='', help='WebhookThrottleConfig holds the configuration for throttling events'), 4 | '#withBurst':: d.fn(help='ThrottleBurst is the maximum number of events sent at the same moment default 15 QPS', args=[d.arg(name='burst', type=d.T.integer)]), 5 | withBurst(burst): { burst: burst }, 6 | '#withQps':: d.fn(help='ThrottleQPS maximum number of batches per second default 10 QPS', args=[d.arg(name='qps', type=d.T.integer)]), 7 | withQps(qps): { qps: qps }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/volumeDevice.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeDevice', url='', help='volumeDevice describes a mapping of a raw block device within a container.'), 4 | '#withDevicePath':: d.fn(help='devicePath is the path inside of the container that the device will be mapped to.', args=[d.arg(name='devicePath', type=d.T.string)]), 5 | withDevicePath(devicePath): { devicePath: devicePath }, 6 | '#withName':: d.fn(help='name must match the name of a persistentVolumeClaim in the pod', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1/volumeAttachmentSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeAttachmentSource', url='', help='VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.'), 4 | '#withPersistentVolumeName':: d.fn(help='Name of the persistent volume to attach.', args=[d.arg(name='persistentVolumeName', type=d.T.string)]), 5 | withPersistentVolumeName(persistentVolumeName): { persistentVolumeName: persistentVolumeName }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /packaging/deb/grafana-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Monitoring system and forwarder 3 | Documentation=https://grafana.com/docs/agent/latest/ 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | Restart=always 9 | User=grafana-agent 10 | Environment=HOSTNAME=%H 11 | EnvironmentFile=/etc/default/grafana-agent 12 | ExecStart=/usr/bin/grafana-agent --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS 13 | # If running the Agent in scraping service mode, you will want to override this value with 14 | # something larger to allow the Agent to gracefully leave the cluster. 4800s is recommend. 15 | TimeoutStopSec=20s 16 | SendSIGKILL=no 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1/rollingUpdateDaemonSet.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateDaemonSet', url='', help='Spec to control the desired behavior of daemon set rolling update.'), 4 | '#withMaxUnavailable':: d.fn(help='IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.', args=[d.arg(name='maxUnavailable', type=d.T.string)]), 5 | withMaxUnavailable(maxUnavailable): { maxUnavailable: maxUnavailable }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1alpha1/volumeAttachmentSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeAttachmentSource', url='', help='VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.'), 4 | '#withPersistentVolumeName':: d.fn(help='Name of the persistent volume to attach.', args=[d.arg(name='persistentVolumeName', type=d.T.string)]), 5 | withPersistentVolumeName(persistentVolumeName): { persistentVolumeName: persistentVolumeName }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1beta1/volumeAttachmentSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeAttachmentSource', url='', help='VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.'), 4 | '#withPersistentVolumeName':: d.fn(help='Name of the persistent volume to attach.', args=[d.arg(name='persistentVolumeName', type=d.T.string)]), 5 | withPersistentVolumeName(persistentVolumeName): { persistentVolumeName: persistentVolumeName }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /packaging/rpm/grafana-agent.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Monitoring system and forwarder 3 | Documentation=https://grafana.com/docs/agent/latest/ 4 | Wants=network-online.target 5 | After=network-online.target 6 | 7 | [Service] 8 | Restart=always 9 | User=grafana-agent 10 | Environment=HOSTNAME=%H 11 | EnvironmentFile=/etc/sysconfig/grafana-agent 12 | ExecStart=/usr/bin/grafana-agent --config.file $CONFIG_FILE --log.level $LOG_LEVEL $CUSTOM_ARGS 13 | # If running the Agent in scraping service mode, you will want to override this value with 14 | # something larger to allow the Agent to gracefully leave the cluster. 4800s is recommend. 15 | TimeoutStopSec=20s 16 | SendSIGKILL=no 17 | 18 | [Install] 19 | WantedBy=multi-user.target 20 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/admissionregistration/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | mutatingWebhook: (import 'mutatingWebhook.libsonnet'), 5 | mutatingWebhookConfiguration: (import 'mutatingWebhookConfiguration.libsonnet'), 6 | ruleWithOperations: (import 'ruleWithOperations.libsonnet'), 7 | serviceReference: (import 'serviceReference.libsonnet'), 8 | validatingWebhook: (import 'validatingWebhook.libsonnet'), 9 | validatingWebhookConfiguration: (import 'validatingWebhookConfiguration.libsonnet'), 10 | webhookClientConfig: (import 'webhookClientConfig.libsonnet'), 11 | } 12 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/apps/v1beta2/rollingUpdateDaemonSet.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateDaemonSet', url='', help='Spec to control the desired behavior of daemon set rolling update.'), 4 | '#withMaxUnavailable':: d.fn(help='IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.', args=[d.arg(name='maxUnavailable', type=d.T.string)]), 5 | withMaxUnavailable(maxUnavailable): { maxUnavailable: maxUnavailable }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/rollingUpdateDaemonSet.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='rollingUpdateDaemonSet', url='', help='Spec to control the desired behavior of daemon set rolling update.'), 4 | '#withMaxUnavailable':: d.fn(help='IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.', args=[d.arg(name='maxUnavailable', type=d.T.string)]), 5 | withMaxUnavailable(maxUnavailable): { maxUnavailable: maxUnavailable }, 6 | '#mixin': 'ignore', 7 | mixin: self 8 | } -------------------------------------------------------------------------------- /pkg/operator/defaults.go: -------------------------------------------------------------------------------- 1 | package operator 2 | 3 | // Supported versions of the Grafana Agent. 4 | var ( 5 | AgentCompatibilityMatrix = []string{ 6 | "v0.14.0", 7 | "v0.15.0", 8 | // "v0.16.0", // Pulled due to critical bug fixed in v0.16.1. 9 | "v0.16.1", 10 | "v0.17.0", 11 | "v0.18.0", 12 | "v0.18.1", 13 | "v0.18.2", 14 | "v0.18.3", 15 | "v0.18.4", 16 | "v0.19.0", 17 | 18 | // NOTE(rfratto): when performing an upgrade, add the newest version above instead of changing the existing reference. 19 | } 20 | 21 | DefaultAgentVersion = AgentCompatibilityMatrix[len(AgentCompatibilityMatrix)-1] 22 | DefaultAgentBaseImage = "grafana/agent" 23 | DefaultAgentImage = DefaultAgentBaseImage + ":" + DefaultAgentVersion 24 | ) 25 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/secretReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='secretReference', url='', help='SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace'), 4 | '#withName':: d.fn(help='Name is unique within a namespace to reference a secret resource.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNamespace':: d.fn(help='Namespace defines the space within which the secret name must be unique.', args=[d.arg(name='namespace', type=d.T.string)]), 7 | withNamespace(namespace): { namespace: namespace }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/volumeDevice.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeDevice', url='', help='volumeDevice describes a mapping of a raw block device within a container.'), 4 | '#withDevicePath':: d.fn(help='devicePath is the path inside of the container that the device will be mapped to.', args=[d.arg(name='devicePath', type=d.T.string)]), 5 | withDevicePath(devicePath): { devicePath: devicePath }, 6 | '#withName':: d.fn(help='name must match the name of a persistentVolumeClaim in the pod', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/extensions/v1beta1/hostPortRange.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='hostPortRange', url='', help='HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined. Deprecated: use HostPortRange from policy API Group instead.'), 4 | '#withMax':: d.fn(help='max is the end of the range, inclusive.', args=[d.arg(name='max', type=d.T.integer)]), 5 | withMax(max): { max: max }, 6 | '#withMin':: d.fn(help='min is the start of the range, inclusive.', args=[d.arg(name='min', type=d.T.integer)]), 7 | withMin(min): { min: min }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /pkg/agentproto/agent.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package agentproto; 4 | option go_package = "github.com/grafana/agent/pkg/agentproto"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | // ScrapingService holds methods that can be called against a Prometheus 9 | // Scraping Service instance. 10 | // 11 | // These methods are only available when the agent config file has enabled the 12 | // scraping service mode. If the scraping service mode is not enabling, 13 | // invoking any of the RPCs here will return a not found error. 14 | service ScrapingService { 15 | // Reshard tells the implementing service to reshard all of its running 16 | // configs. 17 | rpc Reshard(ReshardRequest) returns (google.protobuf.Empty); 18 | } 19 | 20 | message ReshardRequest {} -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/secretReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='secretReference', url='', help='SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace'), 4 | '#withName':: d.fn(help='Name is unique within a namespace to reference a secret resource.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNamespace':: d.fn(help='Namespace defines the space within which the secret name must be unique.', args=[d.arg(name='namespace', type=d.T.string)]), 7 | withNamespace(namespace): { namespace: namespace }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/pluginlist.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * Returns a new pluginlist panel that can be added in a row. 4 | * It requires the pluginlist panel plugin in grafana, which is built-in. 5 | * 6 | * @name pluginlist.new 7 | * 8 | * @param title The title of the pluginlist panel. 9 | * @param description Description of the panel 10 | * @param limit Set maximum items in a list 11 | * @return A json that represents a pluginlist panel 12 | */ 13 | new( 14 | title, 15 | description=null, 16 | limit=null, 17 | ):: { 18 | type: 'pluginlist', 19 | title: title, 20 | [if limit != null then 'limit']: limit, 21 | [if description != null then 'description']: description, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/networking/v1/serviceBackendPort.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='serviceBackendPort', url='', help='ServiceBackendPort is the service port being referenced.'), 4 | '#withName':: d.fn(help='Name is the name of the port on the Service. This is a mutually exclusive setting with "Number".', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNumber':: d.fn(help='Number is the numerical port number (e.g. 80) on the Service. This is a mutually exclusive setting with "Name".', args=[d.arg(name='number', type=d.T.integer)]), 7 | withNumber(number): { number: number }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_custom/batch.libsonnet: -------------------------------------------------------------------------------- 1 | local d = import 'doc-util/main.libsonnet'; 2 | 3 | local patch = { 4 | cronJob+: { 5 | '#new'+: d.func.withArgs([ 6 | d.arg('name', d.T.string), 7 | d.arg('schedule', d.T.string), 8 | d.arg('containers', d.T.array), 9 | ]), 10 | new( 11 | name, 12 | schedule='', 13 | containers=[] 14 | ):: 15 | super.new(name) 16 | + super.spec.withSchedule(schedule) 17 | + super.spec.jobTemplate.spec.template.spec.withContainers(containers) 18 | + super.spec.jobTemplate.spec.template.metadata.withLabels({ name: name }), 19 | }, 20 | }; 21 | 22 | { 23 | batch+: { 24 | v1beta1+: patch, 25 | v2alpha1+: patch, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/photonPersistentDiskVolumeSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='photonPersistentDiskVolumeSource', url='', help='Represents a Photon Controller persistent disk resource.'), 4 | '#withFsType':: d.fn(help='Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.', args=[d.arg(name='fsType', type=d.T.string)]), 5 | withFsType(fsType): { fsType: fsType }, 6 | '#withPdID':: d.fn(help='ID that identifies Photon Controller persistent disk', args=[d.arg(name='pdID', type=d.T.string)]), 7 | withPdID(pdID): { pdID: pdID }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/influxdb.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * Return an InfluxDB Target 4 | * 5 | * @param query Raw InfluxQL statement 6 | * @param alias Alias By pattern 7 | * @param datasource Datasource 8 | * @param rawQuery En/Disable raw query mode 9 | * @param resultFormat Format results as 'Time series' or 'Table' 10 | 11 | * @return Panel target 12 | */ 13 | target( 14 | query, 15 | alias=null, 16 | datasource=null, 17 | rawQuery=true, 18 | resultFormat='time_series', 19 | ):: { 20 | query: query, 21 | rawQuery: rawQuery, 22 | resultFormat: resultFormat, 23 | 24 | [if alias != null then 'alias']: alias, 25 | [if datasource != null then 'datasource']: datasource, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/v1/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /pkg/metrics/instance/global.go: -------------------------------------------------------------------------------- 1 | package instance 2 | 3 | import "github.com/prometheus/prometheus/config" 4 | 5 | // DefaultGlobalConfig holds default global settings to be used across all instances. 6 | var DefaultGlobalConfig = GlobalConfig{ 7 | Prometheus: config.DefaultGlobalConfig, 8 | } 9 | 10 | // GlobalConfig holds global settings that apply to all instances by default. 11 | type GlobalConfig struct { 12 | Prometheus config.GlobalConfig `yaml:",inline"` 13 | RemoteWrite []*config.RemoteWriteConfig `yaml:"remote_write,omitempty"` 14 | } 15 | 16 | // UnmarshalYAML implements yaml.Unmarshaler. 17 | func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { 18 | *c = DefaultGlobalConfig 19 | 20 | type plain GlobalConfig 21 | return unmarshal((*plain)(c)) 22 | } 23 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/v2beta1/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/autoscaling/v2beta2/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authentication/v1/boundObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='boundObjectReference', url='', help='BoundObjectReference is a reference to an object that a token is bound to.'), 4 | '#withKind':: d.fn(help="Kind of the referent. Valid kinds are 'Pod' and 'Secret'.", args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent.', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#withUid':: d.fn(help='UID of the referent.', args=[d.arg(name='uid', type=d.T.string)]), 9 | withUid(uid): { uid: uid }, 10 | '#mixin': 'ignore', 11 | mixin: self, 12 | } 13 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1beta1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/eventSeries.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='eventSeries', url='', help='EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.'), 4 | '#withCount':: d.fn(help='Number of occurrences in this series up to the last heartbeat time', args=[d.arg(name='count', type=d.T.integer)]), 5 | withCount(count): { count: count }, 6 | '#withLastObservedTime':: d.fn(help='MicroTime is version of Time with microsecond level precision.', args=[d.arg(name='lastObservedTime', type=d.T.string)]), 7 | withLastObservedTime(lastObservedTime): { lastObservedTime: lastObservedTime }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/flowcontrol/v1beta1/serviceAccountSubject.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='serviceAccountSubject', url='', help='ServiceAccountSubject holds detailed information for service-account-kind subject.'), 4 | '#withName':: d.fn(help='`name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. Required.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNamespace':: d.fn(help='`namespace` is the namespace of matching ServiceAccount objects. Required.', args=[d.arg(name='namespace', type=d.T.string)]), 7 | withNamespace(namespace): { namespace: namespace }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/rbac/v1alpha1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/photonPersistentDiskVolumeSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='photonPersistentDiskVolumeSource', url='', help='Represents a Photon Controller persistent disk resource.'), 4 | '#withFsType':: d.fn(help='Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.', args=[d.arg(name='fsType', type=d.T.string)]), 5 | withFsType(fsType): { fsType: fsType }, 6 | '#withPdID':: d.fn(help='ID that identifies Photon Controller persistent disk', args=[d.arg(name='pdID', type=d.T.string)]), 7 | withPdID(pdID): { pdID: pdID }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/tcpSocketAction.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='tcpSocketAction', url='', help='TCPSocketAction describes an action based on opening a socket'), 4 | '#withHost':: d.fn(help='Optional: Host name to connect to, defaults to the pod IP.', args=[d.arg(name='host', type=d.T.string)]), 5 | withHost(host): { host: host }, 6 | '#withPort':: d.fn(help='IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.', args=[d.arg(name='port', type=d.T.string)]), 7 | withPort(port): { port: port }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /pkg/integrations/windows_exporter/windows_exporter_windows.go: -------------------------------------------------------------------------------- 1 | package windows_exporter //nolint:golint 2 | 3 | import ( 4 | "github.com/go-kit/kit/log" 5 | "github.com/go-kit/kit/log/level" 6 | "github.com/grafana/agent/pkg/integrations" 7 | "github.com/prometheus-community/windows_exporter/exporter" 8 | ) 9 | 10 | // New creates a new windows_exporter integration. 11 | func New(log log.Logger, c *Config) (integrations.Integration, error) { 12 | configMap := exporter.GenerateConfigs() 13 | c.applyConfig(configMap) 14 | wc, err := exporter.NewWindowsCollector(c.Name(), c.EnabledCollectors, configMap) 15 | if err != nil { 16 | return nil, err 17 | } 18 | _ = level.Info(log).Log("msg", "Enabled windows_exporter collectors") 19 | return integrations.NewCollectorIntegration(c.Name(), integrations.WithCollectors(wc)), nil 20 | } 21 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/events/v1beta1/eventSeries.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='eventSeries', url='', help='EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.'), 4 | '#withCount':: d.fn(help='count is the number of occurrences in this series up to the last heartbeat time.', args=[d.arg(name='count', type=d.T.integer)]), 5 | withCount(count): { count: count }, 6 | '#withLastObservedTime':: d.fn(help='MicroTime is version of Time with microsecond level precision.', args=[d.arg(name='lastObservedTime', type=d.T.string)]), 7 | withLastObservedTime(lastObservedTime): { lastObservedTime: lastObservedTime }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/storage/v1beta1/volumeNodeResources.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeNodeResources', url='', help='VolumeNodeResources is a set of resource limits for scheduling of volumes.'), 4 | '#withCount':: d.fn(help='Maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is nil, then the supported number of volumes on this node is unbounded.', args=[d.arg(name='count', type=d.T.integer)]), 5 | withCount(count): { count: count }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/configMapKeySelector.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='configMapKeySelector', url='', help='Selects a key from a ConfigMap.'), 4 | '#withKey':: d.fn(help='The key to select.', args=[d.arg(name='key', type=d.T.string)]), 5 | withKey(key): { key: key }, 6 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#withOptional':: d.fn(help="Specify whether the ConfigMap or it's key must be defined", args=[d.arg(name='optional', type=d.T.boolean)]), 9 | withOptional(optional): { optional: optional }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/secretEnvSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='secretEnvSource', url='', help="SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables."), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withOptional':: d.fn(help='Specify whether the Secret must be defined', args=[d.arg(name='optional', type=d.T.boolean)]), 7 | withOptional(optional): { optional: optional }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self, 12 | } 13 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/storage/v1/volumeNodeResources.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeNodeResources', url='', help='VolumeNodeResources is a set of resource limits for scheduling of volumes.'), 4 | '#withCount':: d.fn(help='Maximum number of unique volumes managed by the CSI driver that can be used on a node. A volume that is both attached and mounted on a node is considered to be used once, not twice. The same rule applies for a unique volume that is shared among multiple pods on the same node. If this field is not specified, then the supported number of volumes on this node is unbounded.', args=[d.arg(name='count', type=d.T.integer)]), 5 | withCount(count): { count: count }, 6 | '#mixin': 'ignore', 7 | mixin: self, 8 | } 9 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/loadBalancerIngress.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='loadBalancerIngress', url='', help='LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.'), 4 | '#withHostname':: d.fn(help='Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)', args=[d.arg(name='hostname', type=d.T.string)]), 5 | withHostname(hostname): { hostname: hostname }, 6 | '#withIp':: d.fn(help='IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)', args=[d.arg(name='ip', type=d.T.string)]), 7 | withIp(ip): { ip: ip }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | csiDriver: (import 'csiDriver.libsonnet'), 5 | csiDriverSpec: (import 'csiDriverSpec.libsonnet'), 6 | csiNode: (import 'csiNode.libsonnet'), 7 | csiNodeDriver: (import 'csiNodeDriver.libsonnet'), 8 | csiNodeSpec: (import 'csiNodeSpec.libsonnet'), 9 | storageClass: (import 'storageClass.libsonnet'), 10 | volumeAttachment: (import 'volumeAttachment.libsonnet'), 11 | volumeAttachmentSource: (import 'volumeAttachmentSource.libsonnet'), 12 | volumeAttachmentSpec: (import 'volumeAttachmentSpec.libsonnet'), 13 | volumeAttachmentStatus: (import 'volumeAttachmentStatus.libsonnet'), 14 | volumeError: (import 'volumeError.libsonnet') 15 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1alpha1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self, 12 | } 13 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/rbac/v1beta1/roleRef.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='roleRef', url='', help='RoleRef contains information that points to the role being used'), 4 | '#withApiGroup':: d.fn(help='APIGroup is the group for the resource being referenced', args=[d.arg(name='apiGroup', type=d.T.string)]), 5 | withApiGroup(apiGroup): { apiGroup: apiGroup }, 6 | '#withKind':: d.fn(help='Kind is the type of resource being referenced', args=[d.arg(name='kind', type=d.T.string)]), 7 | withKind(kind): { kind: kind }, 8 | '#withName':: d.fn(help='Name is the name of resource being referenced', args=[d.arg(name='name', type=d.T.string)]), 9 | withName(name): { name: name }, 10 | '#mixin': 'ignore', 11 | mixin: self, 12 | } 13 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/v1/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/cortex-jsonnet/cortex-mixin/jsonnetfile.lock.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": "8f9d72b2e35b5f3cc1b7c2a8af9bbae7658804e2", 12 | "sum": "ELsYwK+kGdzX1mee2Yy+/b2mdO4Y503BOCDkFzwmGbE=" 13 | }, 14 | { 15 | "name": "mixin-utils", 16 | "source": { 17 | "git": { 18 | "remote": "https://github.com/grafana/jsonnet-libs", 19 | "subdir": "mixin-utils" 20 | } 21 | }, 22 | "version": "8f9d72b2e35b5f3cc1b7c2a8af9bbae7658804e2", 23 | "sum": "J1iExBloZLjVEvdzHVjvP9AVTqDOJSfFOtBoeQ7EhKk=" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/sessionAffinityConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='sessionAffinityConfig', url='', help='SessionAffinityConfig represents the configurations of session affinity.'), 4 | '#clientIP':: d.obj(help='ClientIPConfig represents the configurations of Client IP based session affinity.'), 5 | clientIP: { 6 | '#withTimeoutSeconds':: d.fn(help='timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours).', args=[d.arg(name='timeoutSeconds', type=d.T.integer)]), 7 | withTimeoutSeconds(timeoutSeconds): { clientIP+: { timeoutSeconds: timeoutSeconds } } 8 | }, 9 | '#mixin': 'ignore', 10 | mixin: self 11 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/v2beta1/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/autoscaling/v2beta2/crossVersionObjectReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='crossVersionObjectReference', url='', help='CrossVersionObjectReference contains enough information to let you identify the referred resource.'), 4 | '#withKind':: d.fn(help='Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"', args=[d.arg(name='kind', type=d.T.string)]), 5 | withKind(kind): { kind: kind }, 6 | '#withName':: d.fn(help='Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1/overhead.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='overhead', url='', help='Overhead structure represents the resource overhead associated with running a pod.'), 4 | '#withPodFixed':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.', args=[d.arg(name='podFixed', type=d.T.object)]), 5 | withPodFixed(podFixed): { podFixed: podFixed }, 6 | '#withPodFixedMixin':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.\n\n**Note:** This function appends passed data to existing values', args=[d.arg(name='podFixed', type=d.T.object)]), 7 | withPodFixedMixin(podFixed): { podFixed+: podFixed }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/tanka/grafana-agent/v2/internal/controllers/daemonset.libsonnet: -------------------------------------------------------------------------------- 1 | function() { 2 | local this = self, 3 | local _config = this._config, 4 | local name = _config.name, 5 | local namespace = _config.namespace, 6 | 7 | local k = (import 'ksonnet-util/kausal.libsonnet') { _config+:: this._config }, 8 | local daemonSet = k.apps.v1.daemonSet, 9 | 10 | controller: 11 | daemonSet.new(name, [this.container]) + 12 | daemonSet.mixin.metadata.withNamespace(namespace) + 13 | daemonSet.mixin.spec.template.spec.withServiceAccount(name) + 14 | ( 15 | if _config.config_hash 16 | then daemonSet.mixin.spec.template.metadata.withAnnotationsMixin({ 17 | config_hash: std.md5(std.toString(_config.agent_config)), 18 | }) 19 | else {} 20 | ) + 21 | k.util.configVolumeMount(name, '/etc/agent'), 22 | } 23 | -------------------------------------------------------------------------------- /example/docker-compose/agent/instance-configs/agents.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: 'docker_compose' 9 | container: 'agent-1' 10 | pod: 'grafana-agent-1' 11 | - job_name: agent-2 12 | static_configs: 13 | - targets: ['agent-2:12345'] 14 | labels: 15 | cluster: 'docker_compose' 16 | container: 'agent-2' 17 | pod: 'grafana-agent-2' 18 | - job_name: agent-3 19 | static_configs: 20 | - targets: ['agent-3:12345'] 21 | labels: 22 | cluster: 'docker_compose' 23 | container: 'agent-3' 24 | pod: 'grafana-agent-3' 25 | remote_write: 26 | - url: http://cortex:9009/api/prom/push 27 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/configMapEnvSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='configMapEnvSource', url='', help="ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables."), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withOptional':: d.fn(help='Specify whether the ConfigMap must be defined', args=[d.arg(name='optional', type=d.T.boolean)]), 7 | withOptional(optional): { optional: optional }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1alpha1/overhead.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='overhead', url='', help='Overhead structure represents the resource overhead associated with running a pod.'), 4 | '#withPodFixed':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.', args=[d.arg(name='podFixed', type=d.T.object)]), 5 | withPodFixed(podFixed): { podFixed: podFixed }, 6 | '#withPodFixedMixin':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.\n\n**Note:** This function appends passed data to existing values', args=[d.arg(name='podFixed', type=d.T.object)]), 7 | withPodFixedMixin(podFixed): { podFixed+: podFixed }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/node/v1beta1/overhead.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='overhead', url='', help='Overhead structure represents the resource overhead associated with running a pod.'), 4 | '#withPodFixed':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.', args=[d.arg(name='podFixed', type=d.T.object)]), 5 | withPodFixed(podFixed): { podFixed: podFixed }, 6 | '#withPodFixedMixin':: d.fn(help='PodFixed represents the fixed resource overhead associated with running a pod.\n\n**Note:** This function appends passed data to existing values', args=[d.arg(name='podFixed', type=d.T.object)]), 7 | withPodFixedMixin(podFixed): { podFixed+: podFixed }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Days without any activity until an issue is labeled as stale 2 | daysUntilStale: 30 3 | 4 | # Days after having the stale label that the issue will be closed 5 | daysUntilClose: 7 6 | 7 | # Labels that prevent issues from being marked as stale 8 | exemptLabels: 9 | - keepalive 10 | - proposal 11 | - outdated-dependency 12 | 13 | # Label to use to identify a stale issue 14 | staleLabel: stale 15 | 16 | # Comment to post when marking an issue as stale. Leave as false 17 | # to disable. 18 | markComment: > 19 | This issue has been automatically marked as stale because it has not had any 20 | activity in the past 30 days. It will be closed in 7 days if no further 21 | activity occurs. Thank you for your contributions. 22 | 23 | # Comment to post when closing a stale issue. Leave as 24 | # false to disable. 25 | closeComment: false 26 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/limitRangeSpec.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='limitRangeSpec', url='', help='LimitRangeSpec defines a min/max usage limit for resources that match on kind.'), 4 | '#withLimits':: d.fn(help='Limits is the list of LimitRangeItem objects that are enforced.', args=[d.arg(name='limits', type=d.T.array)]), 5 | withLimits(limits): { limits: if std.isArray(v=limits) then limits else [limits] }, 6 | '#withLimitsMixin':: d.fn(help='Limits is the list of LimitRangeItem objects that are enforced.\n\n**Note:** This function appends passed data to existing values', args=[d.arg(name='limits', type=d.T.array)]), 7 | withLimitsMixin(limits): { limits+: if std.isArray(v=limits) then limits else [limits] }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/tcpSocketAction.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='tcpSocketAction', url='', help='TCPSocketAction describes an action based on opening a socket'), 4 | '#withHost':: d.fn(help='Optional: Host name to connect to, defaults to the pod IP.', args=[d.arg(name='host', type=d.T.string)]), 5 | withHost(host): { host: host }, 6 | '#withPort':: d.fn(help='IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.', args=[d.arg(name='port', type=d.T.string)]), 7 | withPort(port): { port: port }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/graphite.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * Return an Graphite Target 4 | * 5 | * @param target Graphite Query. Nested queries are possible by adding the query reference (refId). 6 | * @param targetFull Expanding the @target. Used in nested queries. 7 | * @param hide Disable query on graph. 8 | * @param textEditor Enable raw query mode. 9 | * @param datasource Datasource. 10 | 11 | * @return Panel target 12 | */ 13 | target( 14 | target, 15 | targetFull=null, 16 | hide=false, 17 | textEditor=false, 18 | datasource=null, 19 | ):: { 20 | target: target, 21 | hide: hide, 22 | textEditor: textEditor, 23 | 24 | [if targetFull != null then 'targetFull']: targetFull, 25 | [if datasource != null then 'datasource']: datasource, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /example/docker-compose/vendor/github.com/grafana/grafonnet-lib/grafonnet/row.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | new( 3 | title='Dashboard Row', 4 | height=null, 5 | collapse=false, 6 | repeat=null, 7 | showTitle=null, 8 | titleSize='h6' 9 | ):: { 10 | collapse: collapse, 11 | collapsed: collapse, 12 | [if height != null then 'height']: height, 13 | panels: [], 14 | repeat: repeat, 15 | repeatIteration: null, 16 | repeatRowId: null, 17 | showTitle: 18 | if showTitle != null then 19 | showTitle 20 | else 21 | title != 'Dashboard Row', 22 | title: title, 23 | type: 'row', 24 | titleSize: titleSize, 25 | addPanels(panels):: self { 26 | panels+: panels, 27 | }, 28 | addPanel(panel, gridPos={}):: self { 29 | panels+: [panel { gridPos: gridPos }], 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /pkg/metrics/instance/configstore/errors.go: -------------------------------------------------------------------------------- 1 | package configstore 2 | 3 | import "fmt" 4 | 5 | // ErrNotConnected is used when a store operation was called but no connection 6 | // to the store was active. 7 | var ErrNotConnected = fmt.Errorf("not connected to store") 8 | 9 | // NotExistError is used when a config doesn't exist. 10 | type NotExistError struct { 11 | Key string 12 | } 13 | 14 | // Error implements error. 15 | func (e NotExistError) Error() string { 16 | return fmt.Sprintf("configuration %s does not exist", e.Key) 17 | } 18 | 19 | // NotUniqueError is used when two scrape jobs have the same name. 20 | type NotUniqueError struct { 21 | ScrapeJob string 22 | } 23 | 24 | // Error implements error. 25 | func (e NotUniqueError) Error() string { 26 | return fmt.Sprintf("found multiple scrape configs in config store with job name %q", e.ScrapeJob) 27 | } 28 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/authentication/v1/tokenRequestStatus.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='tokenRequestStatus', url='', help='TokenRequestStatus is the result of a token request.'), 4 | '#withExpirationTimestamp':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='expirationTimestamp', type=d.T.string)]), 5 | withExpirationTimestamp(expirationTimestamp): { expirationTimestamp: expirationTimestamp }, 6 | '#withToken':: d.fn(help='Token is the opaque bearer token.', args=[d.arg(name='token', type=d.T.string)]), 7 | withToken(token): { token: token }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/configMapKeySelector.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='configMapKeySelector', url='', help='Selects a key from a ConfigMap.'), 4 | '#withKey':: d.fn(help='The key to select.', args=[d.arg(name='key', type=d.T.string)]), 5 | withKey(key): { key: key }, 6 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 7 | withName(name): { name: name }, 8 | '#withOptional':: d.fn(help='Specify whether the ConfigMap or its key must be defined', args=[d.arg(name='optional', type=d.T.boolean)]), 9 | withOptional(optional): { optional: optional }, 10 | '#mixin': 'ignore', 11 | mixin: self, 12 | } 13 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/secretEnvSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='secretEnvSource', url='', help="SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables."), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withOptional':: d.fn(help='Specify whether the Secret must be defined', args=[d.arg(name='optional', type=d.T.boolean)]), 7 | withOptional(optional): { optional: optional }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1/volumeError.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeError', url='', help='VolumeError captures an error encountered during a volume operation.'), 4 | '#withMessage':: d.fn(help='String detailing the error encountered during Attach or Detach operation. This string may be logged, so it should not contain sensitive information.', args=[d.arg(name='message', type=d.T.string)]), 5 | withMessage(message): { message: message }, 6 | '#withTime':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='time', type=d.T.string)]), 7 | withTime(time): { time: time }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1alpha1/volumeError.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeError', url='', help='VolumeError captures an error encountered during a volume operation.'), 4 | '#withMessage':: d.fn(help='String detailing the error encountered during Attach or Detach operation. This string maybe logged, so it should not contain sensitive information.', args=[d.arg(name='message', type=d.T.string)]), 5 | withMessage(message): { message: message }, 6 | '#withTime':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='time', type=d.T.string)]), 7 | withTime(time): { time: time }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/storage/v1beta1/volumeError.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='volumeError', url='', help='VolumeError captures an error encountered during a volume operation.'), 4 | '#withMessage':: d.fn(help='String detailing the error encountered during Attach or Detach operation. This string may be logged, so it should not contain sensitive information.', args=[d.arg(name='message', type=d.T.string)]), 5 | withMessage(message): { message: message }, 6 | '#withTime':: d.fn(help='Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.', args=[d.arg(name='time', type=d.T.string)]), 7 | withTime(time): { time: time }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/admissionregistration/v1beta1/serviceReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='serviceReference', url='', help='ServiceReference holds a reference to Service.legacy.k8s.io'), 4 | '#withName':: d.fn(help='`name` is the name of the service. Required', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNamespace':: d.fn(help='`namespace` is the namespace of the service. Required', args=[d.arg(name='namespace', type=d.T.string)]), 7 | withNamespace(namespace): { namespace: namespace }, 8 | '#withPath':: d.fn(help='`path` is an optional URL path which will be sent in any request to this service.', args=[d.arg(name='path', type=d.T.string)]), 9 | withPath(path): { path: path }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/auditregistration/v1alpha1/serviceReference.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='serviceReference', url='', help='ServiceReference holds a reference to Service.legacy.k8s.io'), 4 | '#withName':: d.fn(help='`name` is the name of the service. Required', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withNamespace':: d.fn(help='`namespace` is the namespace of the service. Required', args=[d.arg(name='namespace', type=d.T.string)]), 7 | withNamespace(namespace): { namespace: namespace }, 8 | '#withPath':: d.fn(help='`path` is an optional URL path which will be sent in any request to this service.', args=[d.arg(name='path', type=d.T.string)]), 9 | withPath(path): { path: path }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/configMapEnvSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='configMapEnvSource', url='', help="ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables."), 4 | '#withName':: d.fn(help='Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withOptional':: d.fn(help='Specify whether the ConfigMap must be defined', args=[d.arg(name='optional', type=d.T.boolean)]), 7 | withOptional(optional): { optional: optional }, 8 | '#mixin': 'ignore', 9 | mixin: self, 10 | } 11 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/core/v1/sessionAffinityConfig.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='sessionAffinityConfig', url='', help='SessionAffinityConfig represents the configurations of session affinity.'), 4 | '#clientIP':: d.obj(help='ClientIPConfig represents the configurations of Client IP based session affinity.'), 5 | clientIP: { 6 | '#withTimeoutSeconds':: d.fn(help='timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours).', args=[d.arg(name='timeoutSeconds', type=d.T.integer)]), 7 | withTimeoutSeconds(timeoutSeconds): { clientIP+: { timeoutSeconds: timeoutSeconds } }, 8 | }, 9 | '#mixin': 'ignore', 10 | mixin: self, 11 | } 12 | -------------------------------------------------------------------------------- /production/kubernetes/build/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.21/_gen/networking/v1beta1/main.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='v1beta1', url='', help=''), 4 | httpIngressPath: (import 'httpIngressPath.libsonnet'), 5 | httpIngressRuleValue: (import 'httpIngressRuleValue.libsonnet'), 6 | ingress: (import 'ingress.libsonnet'), 7 | ingressBackend: (import 'ingressBackend.libsonnet'), 8 | ingressClass: (import 'ingressClass.libsonnet'), 9 | ingressClassParametersReference: (import 'ingressClassParametersReference.libsonnet'), 10 | ingressClassSpec: (import 'ingressClassSpec.libsonnet'), 11 | ingressRule: (import 'ingressRule.libsonnet'), 12 | ingressSpec: (import 'ingressSpec.libsonnet'), 13 | ingressStatus: (import 'ingressStatus.libsonnet'), 14 | ingressTLS: (import 'ingressTLS.libsonnet'), 15 | } 16 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/endpointPort.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='endpointPort', url='', help='EndpointPort is a tuple that describes a single port.'), 4 | '#withName':: d.fn(help='The name of this port (corresponds to ServicePort.Name). Must be a DNS_LABEL. Optional only if one port is defined.', args=[d.arg(name='name', type=d.T.string)]), 5 | withName(name): { name: name }, 6 | '#withPort':: d.fn(help='The port number of the endpoint.', args=[d.arg(name='port', type=d.T.integer)]), 7 | withPort(port): { port: port }, 8 | '#withProtocol':: d.fn(help='The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.', args=[d.arg(name='protocol', type=d.T.string)]), 9 | withProtocol(protocol): { protocol: protocol }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/hostPathVolumeSource.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='hostPathVolumeSource', url='', help='Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.'), 4 | '#withPath':: d.fn(help='Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath', args=[d.arg(name='path', type=d.T.string)]), 5 | withPath(path): { path: path }, 6 | '#withType':: d.fn(help='Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath', args=[d.arg(name='type', type=d.T.string)]), 7 | withType(type): { type: type }, 8 | '#mixin': 'ignore', 9 | mixin: self 10 | } -------------------------------------------------------------------------------- /production/tanka/grafana-agent/v2/internal/controllers/deployment.libsonnet: -------------------------------------------------------------------------------- 1 | function(replicas=1) { 2 | local this = self, 3 | local _config = this._config, 4 | local name = _config.name, 5 | local namespace = _config.namespace, 6 | 7 | local k = (import 'ksonnet-util/kausal.libsonnet') { _config+:: this._config } }, 8 | 9 | local deployment = k.apps.v1.deployment, 10 | 11 | controller: 12 | deployment.new(name, replicas, [this.container]) + 13 | deployment.mixin.metadata.withNamespace(namespace) + 14 | deployment.mixin.spec.template.spec.withServiceAccount(name) + 15 | ( 16 | if _config.config_hash 17 | then deployment.mixin.spec.template.metadata.withAnnotationsMixin({ 18 | config_hash: std.md5(std.toString(_config.agent_config)), 19 | }) 20 | else {} 21 | ) + 22 | k.util.configVolumeMount(name, '/etc/agent'), 23 | } 24 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/grafana/grafonnet-lib/grafonnet/alertlist.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | * @name alertlist.new 4 | */ 5 | new( 6 | title='', 7 | span=null, 8 | show='current', 9 | limit=10, 10 | sortOrder=1, 11 | stateFilter=[], 12 | onlyAlertsOnDashboard=true, 13 | transparent=null, 14 | description=null, 15 | datasource=null, 16 | ):: 17 | { 18 | [if transparent != null then 'transparent']: transparent, 19 | title: title, 20 | [if span != null then 'span']: span, 21 | type: 'alertlist', 22 | show: show, 23 | limit: limit, 24 | sortOrder: sortOrder, 25 | [if show != 'changes' then 'stateFilter']: stateFilter, 26 | onlyAlertsOnDashboard: onlyAlertsOnDashboard, 27 | [if description != null then 'description']: description, 28 | datasource: datasource, 29 | }, 30 | } 31 | -------------------------------------------------------------------------------- /example/k3d/vendor/github.com/jsonnet-libs/k8s-alpha/1.14/_gen/core/v1/componentCondition.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local d = (import 'doc-util/main.libsonnet'), 3 | '#':: d.pkg(name='componentCondition', url='', help='Information about the condition of a component.'), 4 | '#withError':: d.fn(help='Condition error code for a component. For example, a health check error code.', args=[d.arg(name='err', type=d.T.string)]), 5 | withError(err): { 'error': err }, 6 | '#withMessage':: d.fn(help='Message about the condition for a component. For example, information about a health check.', args=[d.arg(name='message', type=d.T.string)]), 7 | withMessage(message): { message: message }, 8 | '#withType':: d.fn(help='Type of condition for a component. Valid value: "Healthy"', args=[d.arg(name='type', type=d.T.string)]), 9 | withType(type): { type: type }, 10 | '#mixin': 'ignore', 11 | mixin: self 12 | } --------------------------------------------------------------------------------