mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-28 12:55:57 +03:00
caddyfile: Move metrics into caddy package
This commit is contained in:
parent
05b3938556
commit
5f9cba0f19
2 changed files with 6 additions and 3 deletions
6
caddy.go
6
caddy.go
|
@ -600,6 +600,12 @@ func ValidateAndExecuteDirectives(cdyfile Input, inst *Instance, justValidate bo
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, sb := range sblocks {
|
||||||
|
for dir := range sb.Tokens {
|
||||||
|
telemetry.AppendUnique("directives", dir)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inst.context = stype.NewContext(inst)
|
inst.context = stype.NewContext(inst)
|
||||||
if inst.context == nil {
|
if inst.context == nil {
|
||||||
return fmt.Errorf("server type %s produced a nil Context", stypeName)
|
return fmt.Errorf("server type %s produced a nil Context", stypeName)
|
||||||
|
|
|
@ -20,8 +20,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mholt/caddy/telemetry"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Parse parses the input just enough to group tokens, in
|
// Parse parses the input just enough to group tokens, in
|
||||||
|
@ -353,7 +351,6 @@ func (p *parser) directive() error {
|
||||||
|
|
||||||
// The directive itself is appended as a relevant token
|
// The directive itself is appended as a relevant token
|
||||||
p.block.Tokens[dir] = append(p.block.Tokens[dir], p.tokens[p.cursor])
|
p.block.Tokens[dir] = append(p.block.Tokens[dir], p.tokens[p.cursor])
|
||||||
telemetry.AppendUnique("directives", dir)
|
|
||||||
|
|
||||||
for p.Next() {
|
for p.Next() {
|
||||||
if p.Val() == "{" {
|
if p.Val() == "{" {
|
||||||
|
|
Loading…
Reference in a new issue