Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
### Added
- Upcoming changes...

## [0.8.1] - 2025-10-16
### Fixed
- Fixed OpenTelemetry metrics initialization by exporting SetupMetrics function and calling it on server startup

## [0.8.0] - 2025-10-13
### Added
- Added telemetry request time in cryptography handlers
Expand All @@ -28,7 +32,6 @@
### Updated
- Upgraded scanoss/papi dependency to v0.25.1


## [0.7.1] - 2025-10-02
### Bug
- Fixed response status for batch operations
Expand Down Expand Up @@ -93,6 +96,7 @@
- Remove from list those versions that do not contain detections
- Detailed response status message.

[0.8.1]: https://github.com/scanoss/cryptography/compare/v0.8.0...v0.8.1
[0.8.0]: https://github.com/scanoss/cryptography/compare/v0.7.1...v0.8.0
[0.7.1]: https://github.com/scanoss/cryptography/compare/v0.7.0...v0.7.1
[0.7.0]: https://github.com/scanoss/cryptography/compare/v0.6.0...v0.7.0
Expand Down
5 changes: 2 additions & 3 deletions pkg/handlers/cryptography_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ var oltpMetrics = metricsCounters{}
//
// This function initializes histogram metrics for tracking request durations.
// It should be called once during handler initialization to set up the metrics infrastructure.
//
//nolint:unused
func setupMetrics() {

func SetupMetrics() {
meter := otel.Meter("scanoss.com/cryptography")
oltpMetrics.cryptoAlgorithmsHistogram, _ = meter.Int64Histogram("crypto.algorithms.req_time", metric.WithDescription("The time taken to run a crypto algorithms request (ms)"))
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/service/cryptography_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ type cryptographyServer struct {

// NewCryptographyServer creates a new instance of Cryptography Server.
func NewCryptographyServer(db *sqlx.DB, config *myconfig.ServerConfig) pb.CryptographyServer {
// setupMetrics()
// Setups metrics
handlers.SetupMetrics()
return &cryptographyServer{db: db, config: config,
algorithmHandler: handlers.NewCryptographyAlgorithmHandler(db, config),
algorithmInRangeHandler: handlers.NewAlgorithmInRangeHandler(db, config),
Expand Down
Loading