Skip to content

supervisor: persistent_state does not report failed configurations #44432

@tpaschalis

Description

@tpaschalis

Component(s)

cmd/opampsupervisor

What happened?

Description

When the supervisor runs, it saves a persistent_state.yaml file that reports some information about the most recent configuration, like its hash, its status (applied/applying/failed), and an optional error message.

// if the config has not changed report applied status, we should still report a status to the server in this case
s.saveAndReportConfigStatus(protobufs.RemoteConfigStatuses_RemoteConfigStatuses_APPLIED, "")

I think that the only errors that are reported on persistent_state.yaml are for YAML merging and not actual config errors. I'm not sure if that was originally intended but it caught me by surprise.

Steps to Reproduce

Run the supervisor, send a valid YAML that has a bad key.

Expected Result

See the remote status be FAILED

Actual Result

The remote config status is reported as APPLIED with no error message

Collector version

v0.139.0

Environment information

Environment

OS: macOS

OpenTelemetry Collector configuration

extensions:
    opamp:
        capabilities:
            reports_available_components: false
        instance_uid: 019a9c64-5b75-72e4-b193-11beed33277d
        ppid: 1
        ppid_poll_interval: 5s
        server:
            ws:
                endpoint: ws://127.0.0.1:42979/v1/opamp
                tls:
                    insecure: true
service:
    extensions:
        - opamp
    telemetry:
        logs:
            encoding: json
            error_output_paths:
                - stderr
            output_paths:
                - stdout
            processors:
                - batch:
                    exporter:
                        otlp:
                            endpoint: https://otlp/otlp/v1/logs
                            headers:
                                - name: Authorization
                                  value: Basic ${env:BASIC_AUTH}
                            protocol: http/protobuf
        metrics:
            readers:
                - periodic:
                    exporter:
                        otlp:
                            endpoint: https://otlp/otlp/v1/metrics
                            headers:
                                - name: Authorization
                                  value: Basic ${env:BASIC_AUTH}
                            protocol: http/protobuf
        resource:
            host.arch: arm64
            host.name: fd6cd4c3bc46
            os.description: ' '
            os.type: linux
            service.instance.id: 019a9c64-5b75-72e4-b193-11beed33277d
            service.name: otelcol-contrib
            service.version: 0.139.0
        traces:
            processors:
                - batch:
                    exporter:
                        otlp:
                            endpoint: https://otlp/otlp/v1/traces
                            headers:
                                - name: Authorization
                                  value: Basic ${env:BASIC_AUTH}
                            protocol: http/protobuf

Log output

Additional context

I didn't see persistent_state.yaml explicitly mentioned in the supervisor spec, so I may be misjudging the original behavior, but it was surprising, especially as it reuses messages from the original opamp-spec that have a different meaning there.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions