Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Adding a logical to a meter silently fails

Open
#234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
matlab

Research direction

Start by reproducing the counter.add(logical(1)) and counter.add(double(logical(1))) calls shown in the issue, then query the /metrics endpoint with curl and compare the reported values. Trace the counter.add entry point to determine why the logical value has no effect, and verify that logical and converted numeric increments are reflected consistently in the metric.

Written by the indexing model from the issue text.

Description

bug enhancement

Blot

Adding a logical to a meter will not increase the meter value, but also does not throw an error or warning. This isn't a timing issue in the example below, the collector had enough time to update between each increment of the meter and curl call below.

Example

>> m = opentelemetry.metrics.getMeter("test")

m = 

  Meter with properties:

       Name: "test"
    Version: ""
     Schema: ""

>> counter = m.createCounter("mycounter")

counter = 

  Counter with properties:

           Name: "mycounter"
    Description: ""
           Unit: ""

>> counter.add(3)

>> !curl -v http://localhost:8889/metrics
curl: /matlab/bin/glnxa64/libcurl.so.4: no version information available (required by curl)
* Host localhost:8889 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8889...
* Connected to localhost (::1) port 8889
* using HTTP/1.x
> GET /metrics HTTP/1.1

> Host: localhost:8889

> User-Agent: curl/7.88.1

> Accept: */*

> 

* Request completely sent off
< HTTP/1.1 200 OK

< Content-Type: text/plain; version=0.0.4; charset=utf-8; escaping=underscores

< Date: Thu, 08 Jan 2026 20:43:02 GMT

< Content-Length: 190

< Connection: close

< 

# HELP default_mycounter_total 
# TYPE default_mycounter_total counter
default_mycounter_total{job="unknown_service",otel_scope_name="test",otel_scope_schema_url="",otel_scope_version=""} 3
* shutting down connection #0

>> counter.add(logical(1))

>> !curl -v http://localhost:8889/metrics
curl: /matlab/bin/glnxa64/libcurl.so.4: no version information available (required by curl)
* Host localhost:8889 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8889...
* Connected to localhost (::1) port 8889
* using HTTP/1.x
> GET /metrics HTTP/1.1

> Host: localhost:8889

> User-Agent: curl/7.88.1

> Accept: */*

> 

< HTTP/1.1 200 OK

< Content-Type: text/plain; version=0.0.4; charset=utf-8; escaping=underscores

< Date: Thu, 08 Jan 2026 20:46:11 GMT

< Content-Length: 190

< Connection: close

< 

# HELP default_mycounter_total 
# TYPE default_mycounter_total counter
default_mycounter_total{job="unknown_service",otel_scope_name="test",otel_scope_schema_url="",otel_scope_version=""} 3
* we are done reading and this is set to close, stop send
* abort upload
* shutting down connection #0

>> counter.add(double(logical(1)))
>> !curl -v http://localhost:8889/metrics
curl: /matlab/bin/glnxa64/libcurl.so.4: no version information available (required by curl)
* Host localhost:8889 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8889...
* Connected to localhost (::1) port 8889
* using HTTP/1.x
> GET /metrics HTTP/1.1

> Host: localhost:8889

> User-Agent: curl/7.88.1

> Accept: */*

> 

* Request completely sent off
< HTTP/1.1 200 OK

< Content-Type: text/plain; version=0.0.4; charset=utf-8; escaping=underscores

< Date: Thu, 08 Jan 2026 20:51:06 GMT

< Content-Length: 190

< Connection: close

< 

# HELP default_mycounter_total 
# TYPE default_mycounter_total counter
default_mycounter_total{job="unknown_service",otel_scope_name="test",otel_scope_schema_url="",otel_scope_version=""} 4
* shutting down connection #0
Dominant language
MATLAB
Stars
19
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/OpenTelemetry-MATLAB

All issues in mathworks/OpenTelemetry-MATLAB

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.