kubeedge / kubeedge/mapper-framework
[Bug] OTEL push method is stored as a database method
- Dominant language
- Go
- Stars
- 6
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
**What happened**:
`buildPropertiesFromGrpc()` assigns the OTEL push method constant to `DBMethodName` instead of `PushMethod.MethodName`. The generated mapper therefore does not recognize the property as an OTEL push method.
**What you expected to happen**:
A device property configured with an OTEL push method should produce `PushMethod.MethodName == common.PushMethodOTEL` and be initialized by the OTEL handler.
**How to reproduce it**:
1. Build a DMI device with one property whose `PushMethod.Otel` is set.
2. Pass the device to `buildPropertiesFromGrpc()`.
3. Inspect the resulting `DeviceProperty.PushMethod`.
4. The current code leaves `MethodName` empty and writes `otel` into `DBMethodName` instead.
**Proposed fix**:
Store `common.PushMethodOTEL` in `pushMethodName`, matching the HTTP and MQTT branches. A focused regression test covers the parser output.
**Validation**:
`go test -mod=mod ./pkg/util/parse` passes with the repository API dependency on macOS.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with buildPropertiesFromGrpc() in pkg/util/parse and trace the OTEL branch alongside the HTTP and MQTT branches. Run go test -mod=mod ./pkg/util/parse and use the focused regression test to verify that an OTEL property sets PushMethod.MethodName to common.PushMethodOTEL and is initialized by the OTEL handler.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100