@@ -267,18 +267,18 @@ func loadMetadata(filePath string) (metadata, error) {
267267 return md , nil
268268}
269269
270- var componentTypes = map [ string ] func ( string ) string {
271- "connector" : func ( in string ) string { return strings . TrimSuffix ( in , "connector" ) } ,
272- "exporter" : func ( in string ) string { return strings . TrimSuffix ( in , "exporter" ) } ,
273- "extension" : func ( in string ) string { return strings . TrimSuffix ( in , "extension" ) } ,
274- "processor" : func ( in string ) string { return strings . TrimSuffix ( in , "processor" ) } ,
275- "scraper" : func ( in string ) string { return strings . TrimSuffix ( in , "scraper" ) } ,
276- "receiver" : func ( in string ) string { return in } ,
270+ var componentTypes = [] string {
271+ "connector" ,
272+ "exporter" ,
273+ "extension" ,
274+ "processor" ,
275+ "scraper" ,
276+ "receiver" ,
277277}
278278
279279func shortFolderName (filePath string ) string {
280280 parentFolder := filepath .Base (filepath .Dir (filePath ))
281- for cType := range componentTypes {
281+ for _ , cType := range componentTypes {
282282 if strings .HasSuffix (parentFolder , cType ) {
283283 return strings .TrimSuffix (parentFolder , cType )
284284 }
@@ -287,20 +287,12 @@ func shortFolderName(filePath string) string {
287287}
288288
289289func scopeName (filePath string ) string {
290- sn := "otelcol "
290+ sn := "go.opentelemetry.io/collector "
291291 dirs := strings .Split (filepath .Dir (filePath ), string (os .PathSeparator ))
292292 for _ , dir := range dirs {
293- // skip directory names for component types
294- if _ , ok := componentTypes [dir ]; ok {
295- continue
296- }
297- // note here that the only component that receives a different
298- // treatment is receivers. this is to prevent breaking backwards
299- // compatibility for anyone that's using the generated metrics w/
300- // scope names today.
301- for cType , normalizeFunc := range componentTypes {
293+ for _ , cType := range componentTypes {
302294 if strings .HasSuffix (dir , cType ) {
303- sn += "/" + normalizeFunc ( dir )
295+ sn += "/" + dir
304296 }
305297 }
306298 }
0 commit comments