Java client incorrectly flushes metric labels to pushgateway when -Dfile.encoding != UTF-8 · Issue #222 · prometheus/client_java · GitHub
Skip to content

Java client incorrectly flushes metric labels to pushgateway when -Dfile.encoding != UTF-8 #222

Description

@fedotxxl
  1. Start application with -Dfile.encoding=cp1251
  2. Created counter with label 'Привет мир!'
  3. Check :9091/metrics

Looks like the problem is https://github.com/prometheus/client_java/blob/master/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java#L257 :

new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))

I think encoding should be forced to UTF-8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions