Skip to content

Commit

Permalink
Fix metrics option type for legacy OpenMetrics config spec (#9318)
Browse files Browse the repository at this point in the history
* Fix for #9317: Fix incorrect validation spec for istio integration

* update specs

Co-authored-by: John Ejike-Nwogu <[email protected]>
Co-authored-by: Ofek Lev <[email protected]>
  • Loading branch information
3 people authored May 12, 2021
1 parent 4727cd3 commit 23b5f36
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations

from typing import Any, Mapping, Optional, Sequence
from typing import Any, Mapping, Optional, Sequence, Union

from pydantic import BaseModel, root_validator, validator

Expand Down Expand Up @@ -86,7 +86,7 @@ class Config:
label_to_hostname: Optional[str]
labels_mapper: Optional[Mapping[str, Any]]
log_requests: Optional[bool]
metrics: Optional[Sequence[str]]
metrics: Optional[Sequence[Union[str, Mapping[str, str]]]]
min_collection_interval: Optional[float]
namespace: Optional[str]
node_exporter_port: Optional[int]
Expand Down
2 changes: 1 addition & 1 deletion coredns/datadog_checks/coredns/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ instances:
tags:
- dns-pod:%%host%%

## @param metrics - list of strings - optional
## @param metrics - (list of string or mapping) - optional
## List of metrics to be fetched from the prometheus endpoint, if there's a
## value it'll be renamed. This list should contain at least one metric.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
- memory:mem
- io
items:
type: string
anyOf:
- type: string
- type: object
additionalProperties:
type: string
- name: prometheus_metrics_prefix
description: Removes a given <PREFIX> from exposed Prometheus metrics.
value:
Expand Down
4 changes: 2 additions & 2 deletions istio/datadog_checks/istio/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations

from typing import Any, Mapping, Optional, Sequence
from typing import Any, Mapping, Optional, Sequence, Union

from pydantic import BaseModel, root_validator, validator

Expand Down Expand Up @@ -87,7 +87,7 @@ class Config:
label_to_hostname: Optional[str]
labels_mapper: Optional[Mapping[str, Any]]
log_requests: Optional[bool]
metrics: Optional[Sequence[str]]
metrics: Optional[Sequence[Union[str, Mapping[str, str]]]]
min_collection_interval: Optional[float]
mixer_endpoint: Optional[str]
namespace: Optional[str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ instances:
#
namespace: service

## @param metrics - list of strings - required
## @param metrics - (list of string or mapping) - required
## List of metrics to be fetched from the prometheus endpoint, if there's a
## value it'll be renamed. This list should contain at least one metric.
#
Expand Down

0 comments on commit 23b5f36

Please sign in to comment.