Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

"panic: assignment to entry in nil map" when using custom metrics as of 0.5.0 #321

Closed
@9numbernine9

Description

@9numbernine9

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

When using custom metrics, a Go stack trace is generated:

github.com/iamseth/oracledb_exporter/collector.(*Exporter).checkIfMetricsChanged(0xc000290000)
    /go/src/oracledb_exporter/collector/collector.go:353 +0x3e5
<snip>
panic: assignment to entry in nil map

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Specfying a CUSTOM_METRICS environment variable that points to a file with any custom metrics inside of it will do the trick.

What is the expected behavior?

Custom metrics behave as they did previously in 0.4.4.

What is the motivation / use case for changing the behavior?

Using custom metrics. 😄

Please tell us about your environment:

Version: 0.5.0

NOTES

This appears to be a result of commit d0fbef9 . Previously the hashMap was being initialized in main.go but since the refactoring this initialization step isn't being performed anywhere in collector.go, resulting in an attempt to index into an unitialized map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions