Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sd_metrics_params option #1444

Open
supercaracal opened this issue Nov 29, 2024 · 0 comments
Open

sd_metrics_params option #1444

supercaracal opened this issue Nov 29, 2024 · 0 comments

Comments

@supercaracal
Copy link

supercaracal commented Nov 29, 2024

We use some Apache Solr containers on AWS ECS Fargate and collect their metrics via a CloudWatch agent. The endpoint needs a query string parameter for the Prometheus output.

https://solr.apache.org/guide/solr/latest/deployment-guide/monitoring-with-prometheus-and-grafana.html#metrics-api-with-prometheus-format

However, it looks to me like we can't specify the params option to the agent setting.
https://github.com/aws/amazon-cloudwatch-agent/blob/main/internal/ecsservicediscovery/README.md

Is there a way to be able to specify the params option related to Prometheus like this?

{
  "agent": {
    "debug": true
  },
  "logs": {
    "metrics_collected": {
      "prometheus": {
        "prometheus_config_path": "env:PROMETHEUS_CONFIG_CONTENT",
        "log_group_name": "/aws/ecs/containerinsights/foo/prometheus",
        "ecs_service_discovery": {
          "sd_frequency": "1m",
          "sd_result_file": "/tmp/cwagent_ecs_auto_sd.yaml",
          "sd_target_cluster": "foo",
          "sd_cluster_region": "ap-northeast-1",
          "service_name_list_for_tasks": [
            {
              "sd_job_name": "solr",
              "sd_metrics_path": "/solr/admin/metrics",
              "sd_metrics_params": { "wt": "prometheus" },
              "sd_metrics_ports": "8983",
              "sd_service_name_pattern": "^solr$"
            }
          ]
        },
        "emf_processor": {
          "metric_declaration_dedup": true,
          "metric_namespace": "ECS/CustomMetrics",
          "metric_declaration": [
            {
              "source_labels": ["ServiceName"],
              "label_matcher": "^solr$",
              "dimensions": [["ClusterName", "ServiceName", "TaskId"]],
              "metric_selectors": ["^solr_"]
            }
          ]
        }
      }
    }
  }
}
---
global:
  scrape_interval: 1m
  scrape_timeout: 10s
scrape_configs:
  - job_name: cwagent-ecs-file-sd-config
    sample_limit: 10000
    file_sd_configs:
      - files: ["/tmp/cwagent_ecs_auto_sd.yaml"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant