Skip to content

Configuration metadata for Map properties does not include their default value #14813

@wilkinsona

Description

@wilkinsona

The properties for Humio metrics export include a Map<String, String> property with a default value:

/**
 * Humio tags describing the datasource in which metrics will be stored. Humio tags
 * are a distinct concept from Micrometer's tags. Micrometer's tags are used to divide
 * metrics along dimensional boundaries.
 */
private Map<String, String> tags = new HashMap<>(
		Collections.singletonMap("name", "micrometer"));

This default is required to match the default in Micrometer's HumioConfig. The resulting configuration property metadata does not include the default value:

{
      "name": "management.metrics.export.humio.tags",
      "type": "java.util.Map<java.lang.String,java.lang.String>",
      "description": "Humio tags describing the datasource in which metrics will be stored. Humio tags are a distinct concept from Micrometer's tags. Micrometer's tags are used to divide metrics along dimensional boundaries.",
      "sourceType": "org.springframework.boot.actuate.autoconfigure.metrics.export.humio.HumioProperties"
},

I'm not sure if it's possible for the annotation processor to capture the default in the case and, even if it could, what form the default should then take in the JSON. However, it would be good to be able to offer something so that users are aware of the default.

The work in progress to add support for Humio is in this branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions