//-----------------------------------------------------------------------------
//
// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// A copy of the License is located at
//
// http://aws.amazon.com/apache2.0
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.
//
//-----------------------------------------------------------------------------
namespace Amazon.XRay.Recorder.Core.Internal.Utils
{
///
/// This is a class for storing configuration of IConfiguration instance.
///
public class XRayOptions
{
///
/// Default constructor.
///
public XRayOptions()
{
}
///
/// Creates instance of
///
/// Plugin setting.
/// Sampling rule file path
/// AWS Service manifest file path.
/// Tracing disabled value, either true or false.
public XRayOptions(string pluginSetting, string samplingRuleManifest, string awsServiceHandlerManifest,
bool isXRayTracingDisabled) : this(pluginSetting, samplingRuleManifest, awsServiceHandlerManifest, isXRayTracingDisabled, true)
{
}
///
/// Creates instance of
///
/// Plugin setting.
/// Sampling rule file path
/// AWS Service manifest file path.
/// Tracing disabled value, either true or false.
/// Should errors be thrown at runtime if segment not started, either true or false.
///
/// Include the TraceableSqlCommand.CommandText in the sanitized_query section of
/// the SQL subsegment. Parameterized values will appear in their tokenized form and will not be expanded.
/// You should not enable this flag if you are including sensitive information as clear text.
/// This flag can also be overridden for each TraceableSqlCommand instance individually.
/// See the official documentation on SqlCommand.Parameters
///
public XRayOptions(string pluginSetting, string samplingRuleManifest, string awsServiceHandlerManifest, bool isXRayTracingDisabled, bool useRuntimeErrors, bool collectSqlQueries = false)
{
PluginSetting = pluginSetting;
SamplingRuleManifest = samplingRuleManifest;
AwsServiceHandlerManifest = awsServiceHandlerManifest;
IsXRayTracingDisabled = isXRayTracingDisabled;
UseRuntimeErrors = useRuntimeErrors;
CollectSqlQueries = collectSqlQueries;
}
///
/// Plugin setting.
///
public string PluginSetting { get; set; }
///
/// Sampling rule file path.
///
public string SamplingRuleManifest { get; set; }
///
/// AWS Service manifest file path.
///
public string AwsServiceHandlerManifest { get; set; }
///
/// Tracing disabled value, either true or false.
///
public bool IsXRayTracingDisabled { get; set; }
///
/// For missing Segments/Subsegments, if set to true, runtime exception is thrown, if set to false, runtime exceptions are avoided and logged.
///
public bool UseRuntimeErrors { get; set; } = false;
///
/// Include the TraceableSqlCommand.CommandText in the sanitized_query section of
/// the SQL subsegment. Parameterized values will appear in their tokenized form and will not be expanded.
/// You should not enable this flag if you are not including sensitive information as clear text.
/// When set to true, the sanitized sql query will be recorded for all the instances of TraceableSqlCommand
/// in the application, unless it is overridden on the individual TraceableSqlCommand instances.
///
public bool CollectSqlQueries { get; set; } = false;
}
}