Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Processori di pipeline di metriche
I processori Metrics Pipeline trasformano i datapoint metrici OTel durante l'ingestione. Una pipeline di metriche può avere fino a 20 processori, applicati in sequenza nell'ordine in cui sono definiti.
I processori utilizzano le espressioni di percorso OTTL per indirizzare gli attributi a diversi ambiti:
| Path | Scope | Esempio |
|---|---|---|
|
Resource-level |
|
|
Attributo Scope |
|
|
Datapoint-level |
|
|
Forma abbreviata per datapoint |
|
processore add_attributes
Aggiunge o sovrascrive gli attributi sui punti dati metrici. Funziona con tutti i tipi di temporalità.
Equivalente OTTL: set(attributes["key"], "value")
Configurazione
Configura il processore add_attributes con i seguenti parametri:
processor: - add_attributes: attributes: - key: resource.attributes["team"] value: "payments" - key: attributes["environment"] value: "production" - key: instrumentation_scope.attributes["version"] value: "1.0" overwrite_if_key_exists: true
Parameters
attributes(richiesto)-
Matrice di oggetti attributo da aggiungere.
attributes[].key(obbligatorio)-
Percorso dell'attributo OTTL che specifica dove aggiungere l'attributo.
attributes[].value(obbligatorio)-
Valore stringa da assegnare.
attributes[].overwrite_if_key_exists(facoltativo)-
booleano. Quando
true, sovrascrive i valori esistenti. L’impostazione predefinita èfalse. Se impostata sutrue, questa operazione è considerata distruttiva e non si applica alle metriche cumulative o alle metriche vendute.
processore delete_attributes
Rimuove attributi specifici dai punti dati metrici. Non si applica alle metriche cumulative o alle metriche vendute.
Equivalente OTTL: delete_key(attributes, "key")
Configurazione
Configura il processore delete_attributes con i seguenti parametri:
processor: - delete_attributes: with_keys: - resource.attributes["obsolete"] - attributes["temp"] - datapoint.attributes["debug"]
Parameters
with_keys(richiesto)-
Matrice di percorsi di attributi OTTL da rimuovere.
processore rename_attributes
Rinomina le chiavi degli attributi sui punti dati metrici. Non si applica alle metriche cumulative o alle metriche vendute.
Equivalente OTTL: set() + delete_key()
Configurazione
Configura il processore rename_attributes con i seguenti parametri:
processor: - rename_attributes: attributes: - from_key: resource.attributes["old_key"] to_key: resource.attributes["new_key"] overwrite_if_to_key_exists: true
Parameters
attributes(richiesto)-
Serie di operazioni di ridenominazione.
attributes[].from_key(richiesto)-
Percorso dell'attributo OTTL di origine.
attributes[].to_key(obbligatorio)-
Percorso dell'attributo OTTL di destinazione.
attributes[].overwrite_if_to_key_exists(facoltativo)-
booleano. Quando
true, sovrascrive se esiste una chiave di destinazione. L’impostazione predefinita èfalse.
processore rename_metrics
Rinomina i nomi delle metriche. Non si applica alle metriche cumulative o alle metriche vendute.
Equivalente OTTL: set(name, "new.metric.name") where name == "old.metric.name"
Configurazione
Configura il processore rename_metrics con i seguenti parametri:
processor: - rename_metrics: metrics: - from: "old.metric.name" to: "new.metric.name"
Parameters
metrics(richiesto)-
Serie di operazioni di ridenominazione.
metrics[].from(richiesto)-
Nome della metrica corrente.
metrics[].to(richiesto)-
Nuovo nome della metrica.
Processore substitute_attribute_values
Mappa i valori degli attributi tramite una tabella di ricerca. Non si applica alle metriche cumulative o alle metriche vendute.
Equivalente OTTL: replace_match()
Configurazione
Configura il processore substitute_attribute_values con i seguenti parametri:
processor: - substitute_attribute_values: attributes: - key: resource.attributes["region"] from: "us-east-1a" to: "us-east-1"
Parameters
attributes(richiesto)-
Serie di operazioni di sostituzione.
attributes[].key(richiesto)-
percorso dell'attributo OTTL con cui confrontare.
attributes[].from(obbligatorio)-
Valore da abbinare.
attributes[].to(richiesto)-
Valore sostitutivo.
Esempio completo
L'esempio seguente utilizza tutti e cinque i processori in un'unica pipeline:
pipeline: source: cloudwatch_metrics: format: otlp selection_criteria: - match_all: - 'resource.attributes["service.name"] == "my-service"' - 'metric.name == "CPUUtilization"' processor: - add_attributes: attributes: - key: resource.attributes["env"] value: "prod" overwrite_if_key_exists: true - delete_attributes: with_keys: - resource.attributes["internal.trace"] - rename_attributes: attributes: - from_key: resource.attributes["old_key"] to_key: resource.attributes["new_key"] - rename_metrics: metrics: - from: "CPUUtilization" to: "system.cpu.utilization" - substitute_attribute_values: attributes: - key: resource.attributes["environment"] from: "dev" to: "development" sink: - cloudwatch_metrics: {}
Compatibilità e restrizioni dei processori
- Numero massimo di processori
-
Una pipeline di metriche può avere al massimo 20 processori.
- Processori e temporalità distruttivi
-
I processori distruttivi (
delete_attributes,,rename_attributesrename_metricssubstitute_attribute_values, eadd_attributesconoverwrite_if_key_exists: true) non si applicano alle metriche cumulative o alle metriche vendute. Queste metriche vengono passate invariate. - Protezione delle metriche vendute
-
I processori distruttivi non possono modificare le metriche dal punto di partenza.
instrumentation_scope.namecloudwatch.aws/Queste metriche vengono passate invariate.