Skip to content

Commit

Permalink
caddyfile: Move metrics into caddy package
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jun 21, 2019
1 parent 05b3938 commit 5f9cba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions caddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,12 @@ func ValidateAndExecuteDirectives(cdyfile Input, inst *Instance, justValidate bo
return err
}

for _, sb := range sblocks {
for dir := range sb.Tokens {
telemetry.AppendUnique("directives", dir)
}
}

inst.context = stype.NewContext(inst)
if inst.context == nil {
return fmt.Errorf("server type %s produced a nil Context", stypeName)
Expand Down
3 changes: 0 additions & 3 deletions caddyfile/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
"os"
"path/filepath"
"strings"

"github.com/mholt/caddy/telemetry"
)

// Parse parses the input just enough to group tokens, in
Expand Down Expand Up @@ -353,7 +351,6 @@ func (p *parser) directive() error {

// The directive itself is appended as a relevant token
p.block.Tokens[dir] = append(p.block.Tokens[dir], p.tokens[p.cursor])
telemetry.AppendUnique("directives", dir)

for p.Next() {
if p.Val() == "{" {
Expand Down

0 comments on commit 5f9cba0

Please sign in to comment.