Skip to content

Commit

Permalink
Addresses review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrowland committed Nov 18, 2024
1 parent cd1fc60 commit 88e7f21
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
6 changes: 5 additions & 1 deletion helm/examples/metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ To create an index with dynamic mapping, use the following object when creating
}
```

Note that there may be other means for adding the required dynamic mapping to the index.
Note that there may be other means for adding the required dynamic mapping to the index.

The _match_ values above are representative of typical values. The actual values may
vary depending on the cluster configuration and shared use of the index across multiple clusters.
In all cases, the configuration of the sink must match that of the dynamic mappings in the index.

#### Enabling ElasticSearch Metrics Sink for Kubernetes
To enable reporting of metrics to ElasticSearch, add the metric configuration settings to
Expand Down
4 changes: 2 additions & 2 deletions helm/examples/metrics/elasticsearch_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ global:
- type: elastic
name: myelasticsink
settings:
countMetricSuffix: count,
gaugeMetricSuffix: gauge,
countMetricSuffix: count
gaugeMetricSuffix: gauge
histogramMetricSuffix: histogram
host:
protocol: https
Expand Down
22 changes: 14 additions & 8 deletions system/metrics/sinks/elastic/elasticSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ ElasticMetricSink::ElasticMetricSink(const char *name, const IPropertyTree *pSet
configurationValid = !elasticHostUrl.isEmpty() && !indexName.isEmpty();

// Initialize standard suffixes
countMetricSuffix.append("count");
gaugeMetricSuffix.append("gauge");
histogramMetricSuffix.append("histogram");

// See if any are overridden
pSettingsTree->getProp("@countMetricSuffix", countMetricSuffix);
pSettingsTree->getProp("@gaugeMetricSuffix", gaugeMetricSuffix);
pSettingsTree->getProp("@histogramMetricSuffix", histogramMetricSuffix);
if (!pSettingsTree->getProp("@countMetricSuffix", countMetricSuffix))
{
countMetricSuffix.append("count");
}

if (!pSettingsTree->getProp("@gaugeMetricSuffix", gaugeMetricSuffix))
{
gaugeMetricSuffix.append("gauge");
}

if (!pSettingsTree->getProp("@histogramMetricSuffix", histogramMetricSuffix))
{
histogramMetricSuffix.append("histogram");
}
}


Expand Down

0 comments on commit 88e7f21

Please sign in to comment.