Skip to content

Commit

Permalink
fix configuration key name
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed May 14, 2022
1 parent eeea993 commit af7a28e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 h1:ESEyqQqXXFIcImj/BE8oKEX37Zsuceb2cZI+EL/zNCY=
Expand Down
10 changes: 5 additions & 5 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package otel

import (
"context"
"fmt"
"net/http"
"os"
"runtime"
Expand All @@ -27,7 +26,8 @@ import (
)

const (
name string = "otel"
name string = "otel"
configurationKey = "http.otel"
)

type Plugin struct {
Expand All @@ -41,12 +41,12 @@ type Plugin struct {
func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger) error {
const op = errors.Op("otel_plugin_init")

if !cfg.Has(name) {
// name -> http.otel
if !cfg.Has(configurationKey) {
return errors.E(errors.Disabled)
}

// name -> http.otel
err := cfg.UnmarshalKey(fmt.Sprintf("%s.%s", "http", name), &p.cfg)
err := cfg.UnmarshalKey(configurationKey, &p.cfg)
if err != nil {
return errors.E(op, err)
}
Expand Down

0 comments on commit af7a28e

Please sign in to comment.