Skip to content

Commit

Permalink
Ripped out OTEL (#378)
Browse files Browse the repository at this point in the history
* OTEL fixes

* namespace consolidations

* Update appveyor.yml

* Clamped down OTEL version that is not utterly broken and nobody cares to fix

* Downgraded OTEL version to 1.14.2

* Added special vcpkg copy for CI

* Reverted CI-special vcpkg settings

* Fixed build settings

* Update XInputBridge.vcxproj

* Update XInputBridge.vcxproj

* Packages madness

* Update XInputBridge.vcxproj

* Update XInputBridge.vcxproj

* Update appveyor.yml

* More cache trickery

* Update appveyor.yml

* Update appveyor.yml

* I give up, OTEL can suck it

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Throwing OTEL out, I've had enough

* Removed OTEL

* Update README.md
  • Loading branch information
nefarius authored Aug 10, 2024
1 parent c7211ff commit 8f97e90
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 512 deletions.
35 changes: 18 additions & 17 deletions ControlApp/ControlApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
<Version>3.0.0</Version>
<Authors>Kanuan, Nefarius</Authors>
<Copyright>Copyright (c) 2024 Nefarius Software Solutions e.U.</Copyright>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<ItemGroup>
<Content Include="wpfui-icon.ico"/>
<Content Include="wpfui-icon.ico" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,27 +28,27 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nefarius.Utilities.Bluetooth" Version="1.4.8"/>
<PackageReference Include="Nefarius.Utilities.DeviceManagement" Version="3.22.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2"/>
<PackageReference Include="WPF-UI" Version="3.0.4"/>
<PackageReference Include="Nefarius.Utilities.Bluetooth" Version="1.4.8" />
<PackageReference Include="Nefarius.Utilities.DeviceManagement" Version="3.22.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="WPF-UI" Version="3.0.4" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\wpfui-icon-256.png"/>
<None Remove="Assets\wpfui-icon-1024.png"/>
<None Remove="Resources\AltRumbleMode.png"/>
<None Remove="Resources\NormalRumbleMode.png"/>
<None Remove="Assets\wpfui-icon-256.png" />
<None Remove="Assets\wpfui-icon-1024.png" />
<None Remove="Resources\AltRumbleMode.png" />
<None Remove="Resources\NormalRumbleMode.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\wpfui-icon-256.png"/>
<Resource Include="Assets\wpfui-icon-1024.png"/>
<Resource Include="Resources\AltRumbleMode.png"/>
<Resource Include="Resources\NormalRumbleMode.png"/>
<Resource Include="Assets\wpfui-icon-256.png" />
<Resource Include="Assets\wpfui-icon-1024.png" />
<Resource Include="Resources\AltRumbleMode.png" />
<Resource Include="Resources\NormalRumbleMode.png" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions DSHMC/DSHMC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<UseWPF>true</UseWPF>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Platforms>AnyCPU</Platforms>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>FireShock.ico</ApplicationIcon>
Expand Down
39 changes: 0 additions & 39 deletions XInputBridge/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,3 @@
//
#include <absl/cleanup/cleanup.h>
#include <absl/strings/match.h>

//
// OpenTelemetry
//
#if defined(SCPLIB_ENABLE_TELEMETRY)
#define HAVE_ABSEIL // fixes redefinitions of absl types
// gRPC exporter
#include <opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h>

#include <opentelemetry/sdk/trace/processor.h>
#include <opentelemetry/sdk/trace/simple_processor_factory.h>
#include <opentelemetry/sdk/trace/tracer_provider_factory.h>
#include <opentelemetry/sdk/resource/resource.h>
#include <opentelemetry/sdk/resource/semantic_conventions.h>
#include <opentelemetry/trace/provider.h>
#include <opentelemetry/sdk/trace/tracer_provider.h>

namespace trace = opentelemetry::trace;
namespace nostd = opentelemetry::nostd;
namespace sdktrace = opentelemetry::sdk::trace;
namespace otlp = opentelemetry::exporter::otlp;
namespace sdkresource = opentelemetry::sdk::resource;

// gRPC exporter
#include <opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_options.h>

#include <opentelemetry/logs/provider.h>
#include <opentelemetry/sdk/common/global_log_handler.h>
#include <opentelemetry/sdk/logs/logger_provider_factory.h>
#include <opentelemetry/sdk/logs/logger_provider.h>
#include <opentelemetry/sdk/logs/processor.h>
#include <opentelemetry/sdk/logs/simple_log_record_processor_factory.h>

namespace sdklogs = opentelemetry::sdk::logs;
namespace logs = opentelemetry::logs;
#endif

14 changes: 0 additions & 14 deletions XInputBridge/GlobalState.Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,3 @@ std::optional<uint8_t> GlobalState::GetDs3HidDeviceModeProperty(const std::wstri

return hidDeviceMode;
}

#if defined(SCPLIB_ENABLE_TELEMETRY)
nostd::shared_ptr<trace::Tracer> GlobalState::GetTracer()
{
const auto provider = trace::Provider::GetTracerProvider();
return provider->GetTracer(TRACER_NAME, OPENTELEMETRY_SDK_VERSION);
}

nostd::shared_ptr<logs::Logger> GlobalState::GetLogger(const std::string& name)
{
const auto provider = logs::Provider::GetLoggerProvider();
return provider->GetLogger(name, LOGGER_NAME);
}
#endif
5 changes: 0 additions & 5 deletions XInputBridge/GlobalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ class GlobalState
static std::optional<std::vector<std::wstring>> InstanceIdToHidPaths(const std::wstring& InstanceId);
static std::optional<uint8_t> GetDs3HidDeviceModeProperty(const std::wstring& Ds3InstanceId);

#if defined(SCPLIB_ENABLE_TELEMETRY)
static nostd::shared_ptr<trace::Tracer> GetTracer();
static nostd::shared_ptr<logs::Logger> GetLogger(const std::string& name);
#endif

private:
/** The states of each user index slot */
std::vector<DeviceState> States{ DS3_DEVICES_MAX };
Expand Down
14 changes: 0 additions & 14 deletions XInputBridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,6 @@ Gets proxied to `C:\Windows\System32\XInput1_3.dll`.

Gets proxied to `C:\Windows\System32\XInput1_3.dll`.

## OpenTelemetry

The library can be built with `/D SCPLIB_ENABLE_TELEMETRY` which will pull in the [OpenTelemetry C++ Client](https://github.com/open-telemetry/opentelemetry-cpp) and register an [OTLP](https://opentelemetry.io/docs/specs/otlp/) exporter you can use in conjunction with e.g. [Jaeger Tracing](https://www.jaegertracing.io/) to visualize performance metrics. OTEL support isn't enabled by default as it inflates resulting binary size and most users will never need this functionality.

### OTEL-enabled binaries

If you need logging and tracing to hunt down errors or performance bottle-necks you can use an OTEL-enabled copy instead. It comes with all necessary prerequisites compiled in and therefore is like 20-50 times larger than the normal build.

The DLL architecture has to match your game/emulator or it will result in errors.

- [x64 (64-Bit Intel/AMD)](https://buildbot.nefarius.at/builds/DsHidMini/latest/bin/x64/OTEL/XInput1_3.dll) (most used)
- [x86 (32-Bit Intel/AMD)](https://buildbot.nefarius.at/builds/DsHidMini/latest/bin/x86/OTEL/XInput1_3.dll)
- [ARM64 (64-Bit ARM)](https://buildbot.nefarius.at/builds/DsHidMini/latest/bin/arm64/OTEL/XInput1_3.dll)

## Sources & 3rd party credits

This application benefits from these awesome projects ❤ (appearance in no special order):
Expand Down
Loading

0 comments on commit 8f97e90

Please sign in to comment.