Skip to content

Commit 678b45b

Browse files
enhancement: added opentel and honeycomb integration
1 parent afec457 commit 678b45b

File tree

1 file changed

+10
-0
lines changed
  • internal/languages/dotnet/frameworks/dotnet-clean-architecture

1 file changed

+10
-0
lines changed

internal/languages/dotnet/frameworks/dotnet-clean-architecture/copier.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const InfrastructureDataDatabaseContextFactoryCSFile = "/Infrastructure/Data/Dat
8383
// extensions
8484
const InfrastructureExtensionsPath = "/Infrastructure/Extensions"
8585
const InfrastructureExtensionsServicesCollectionExtensionsCSFile = "/Infrastructure/Extensions/ServicesCollectionExtensions.cs.tmpl"
86+
const InfrastructureExtensionsOpenTelemetryRegistrationCSFile = "/Infrastructure/Extensions/OpenTelemetryRegistration.cs.tmpl"
8687

8788
// repositories
8889
const InfrastructureRepositoriesPath = "/Infrastructure/Repositories"
@@ -554,6 +555,15 @@ func (c *Copier) addInfrastructureRelatedDirectoriesAndFiles(resource *corenode.
554555
}
555556
*paths = append(*paths, &targetInfrastructureExtensionsServicesCollectionExtensionsFileName)
556557

558+
// copy infrastructure/extensions/OpenTelemetryRegistration.cs
559+
targetInfrastructureExtensionsOpenTelemetryRegistrationFileName := c.NodeDirectoryName + InfrastructureExtensionsPath + "/" + "OpenTelemetryRegistration.cs"
560+
_, err = utils.CopyFile(targetInfrastructureExtensionsOpenTelemetryRegistrationFileName, c.TemplatesRootPath+InfrastructureExtensionsOpenTelemetryRegistrationCSFile)
561+
if err != nil {
562+
log.Errorf("error copying infrastructure extensions open telemetry registration file: %v", err)
563+
return err
564+
}
565+
*paths = append(*paths, &targetInfrastructureExtensionsOpenTelemetryRegistrationFileName)
566+
557567
// copy infrastructure/repositories/ResourcesNameRepository.cs
558568
targetInfrastructureRepositoriesResourceNameRepositoryFileName := c.NodeDirectoryName + InfrastructureRepositoriesPath + "/" + resource.Name + "Repository.cs"
559569
_, err = utils.CopyFile(targetInfrastructureRepositoriesResourceNameRepositoryFileName, c.TemplatesRootPath+InfrastructureRepositoriesResourceNameRepositoryCSFile)

0 commit comments

Comments
 (0)