Merge pull request #36 from ClusterCockpit/main

Merge main into devel
This commit is contained in:
adityauj 2024-12-04 14:05:50 +01:00 committed by GitHub
commit a21cedd4a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 6 deletions

2
.gitignore vendored
View File

@ -20,7 +20,7 @@
aditya.creds aditya.creds
test.creds test.creds
config.json ./config.json
migrateTimestamps.pl migrateTimestamps.pl
test_ccms_api.sh test_ccms_api.sh

View File

@ -16,7 +16,6 @@ builds:
ldflags: ldflags:
- -s -w -X main.version={{.Version}} - -s -w -X main.version={{.Version}}
- -X main.commit={{.Commit}} -X main.date={{.Date}} - -X main.commit={{.Commit}} -X main.date={{.Date}}
- -linkmode external -extldflags -static
tags: tags:
- static_build - static_build
archives: archives:

View File

@ -4,6 +4,17 @@ This is a minor release of `cc-metric-store`, the metric timeseries cache
implementation of ClusterCockpit. implementation of ClusterCockpit.
For release specific notes visit the [ClusterCockpit Documentation](https://clusterockpit.org/docs/release/). For release specific notes visit the [ClusterCockpit Documentation](https://clusterockpit.org/docs/release/).
Notable changes:
- Cleanup of code and restructuring
- Document REST API with Swagger
- Introduce REST API versioning
- Provide Swagger UI test web-frontend
- Introduce re-sampling of metric data
- Support also ms, ns in line protocol
- Support NATS credentials
## Breaking changes ## Breaking changes
None None

View File

@ -298,7 +298,7 @@ func decodeLine(dec *lineprotocol.Decoder,
} }
if string(key) != "value" { if string(key) != "value" {
return fmt.Errorf("unkown field: '%s' (value: %#v)", string(key), val) return fmt.Errorf("host %s: unknown field: '%s' (value: %#v)", host, string(key), val)
} }
if val.Kind() == lineprotocol.Float { if val.Kind() == lineprotocol.Float {
@ -308,7 +308,7 @@ func decodeLine(dec *lineprotocol.Decoder,
} else if val.Kind() == lineprotocol.Uint { } else if val.Kind() == lineprotocol.Uint {
metric.Value = util.Float(val.UintV()) metric.Value = util.Float(val.UintV())
} else { } else {
return fmt.Errorf("unsupported value type in message: %s", val.Kind().String()) return fmt.Errorf("host %s: unsupported value type in message: %s", host, val.Kind().String())
} }
} }
@ -319,14 +319,14 @@ func decodeLine(dec *lineprotocol.Decoder,
if t, err = dec.Time(lineprotocol.Microsecond, t); err != nil { if t, err = dec.Time(lineprotocol.Microsecond, t); err != nil {
t = time.Now() t = time.Now()
if t, err = dec.Time(lineprotocol.Nanosecond, t); err != nil { if t, err = dec.Time(lineprotocol.Nanosecond, t); err != nil {
return fmt.Errorf("timestamp : %#v with error : %#v", t, err.Error()) return fmt.Errorf("host %s: timestamp : %#v with error : %#v", host, t, err.Error())
} }
} }
} }
} }
if err != nil { if err != nil {
return fmt.Errorf("timestamp : %#v with error : %#v", t, err.Error()) return fmt.Errorf("host %s: timestamp : %#v with error : %#v", host, t, err.Error())
} }
if err := ms.WriteToLevel(lvl, selector, t.Unix(), []memorystore.Metric{metric}); err != nil { if err := ms.WriteToLevel(lvl, selector, t.Unix(), []memorystore.Metric{metric}); err != nil {