Skip to content

MetricReader allows invalid configurations #138

@marcalff

Description

@marcalff

The following schema:

        "MetricReader": {
            "type": ["object", "null"],
            "additionalProperties": false,
            "minProperties": 1,
            "maxProperties": 2,
            "properties": {
                "periodic": {
                    "$ref": "#/$defs/PeriodicMetricReader"
                },
                "pull": {
                    "$ref": "#/$defs/PullMetricReader"
                },
                "producers": {
                    "type": "array",
                    "items": {
                        "$ref": "#/$defs/MetricProducer"
                    }
                }
            }
        },

is causing semantic issues.

Previously, it contained only "periodic" and "pull" properties, with max properties = 1, meaning a metric reader is either periodic or pull.

When producers was added, max properties was changed to 2.
This allows "periodic" + "producers", or "pull" + "producers", which is the intent (as I understand).

This however also allows to have both "periodic" and "pull", which are no longer mutually exclusive.

This opens the schema validation to unintended configurations, pushing this downstream to the SDK implementation.

If this combination is not allowed, this must be clarified explicitly:

  • for end users, to know what to expect
  • for SDK implementors, to test explicitly this case, so it can be handled correctly.

Found while implementing config.yaml for C++:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions