Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dotnet/src/dotnetcore/GxClasses.Web/Middleware/GXRouting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ public GxRestWrapper GetController(HttpContext context, ControllerInfo controlle
GxContext gxContext = GxContext.CreateDefaultInstance();
gxContext.HttpContext = context;
context.NewSessionCheck();
string nspace;
Config.GetValueOf("AppMainNamespace", out nspace);
string nspace = Preferences.AppMainNamespace;

String tmpController = controller;
String addNspace = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ private bool ExecuteHandler(HandlerType type, Object[] parameters)
{
try
{
string nSpace = string.Empty;
Config.GetValueOf("AppMainNamespace", out nSpace);
string nSpace = Preferences.AppMainNamespace;
GXProcedure obj = null;
try
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>GeneXus.OpenTelemetry</AssemblyName>
<PackageTags>OpenTelemetry GeneXus DotNet </PackageTags>
<PackageId>GeneXus.OpenTelemetry.OpenTelemetry</PackageId>
<NoWarn>NU1605</NoWarn>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AssemblyName>GeneXus.OpenTelemetry</AssemblyName>
<PackageTags>OpenTelemetry GeneXus DotNet </PackageTags>
<PackageId>GeneXus.OpenTelemetry.OpenTelemetry</PackageId>
<NoWarn>NU1605</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.4.0" />
Expand Down
8 changes: 8 additions & 0 deletions dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,14 @@ public class Preferences
const string DEFAULT_DS = "Default";
static int httpclient_max_per_route = -1;
static int sessionTimeout = -1;
internal static string AppMainNamespace
{
get
{
Config.GetValueOf("AppMainNamespace", out string nameSpace);
return nameSpace;
}
}
internal static string DefaultDatastore
{
get
Expand Down
11 changes: 10 additions & 1 deletion dotnet/src/dotnetframework/GxClasses/Model/GXBaseObject.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using GeneXus.Configuration;
using GeneXus.Data.NTier;
using GeneXus.Encryption;
using GeneXus.Http;
Expand Down Expand Up @@ -60,9 +61,17 @@ protected virtual void ExecutePrivate()

}
#if NETCORE
internal static string GetObjectNameWithoutNamespace(string gxObjFullName)
{
string mainNamespace = Preferences.AppMainNamespace;
if (gxObjFullName.StartsWith(mainNamespace))
gxObjFullName = gxObjFullName.Remove(0, mainNamespace.Length + 1);
return gxObjFullName;
}
private void ExecuteUsingSpanCode()
{
using (Activity activity = ActivitySource.StartActivity($"{this.GetType().FullName}.execute"))
string gxObjFullName = GetObjectNameWithoutNamespace(GetType().FullName);
using (Activity activity = ActivitySource.StartActivity($"{gxObjFullName}.execute"))
{
ExecutePrivate();
}
Expand Down
3 changes: 2 additions & 1 deletion dotnet/src/dotnetframework/GxClasses/Model/GXSilentTrn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ private Activity InitializeSpan(string methodName)
{
if (GenOtelSpanEnabled())
{
return GXBaseObject.ActivitySource.StartActivity($"{this.GetType().FullName}.{methodName}");
string gxObjFullName = GXBaseObject.GetObjectNameWithoutNamespace(GetType().FullName);
return GXBaseObject.ActivitySource.StartActivity($"{gxObjFullName}.{methodName}");
}
return null;
}
Expand Down